Re: [Tutor] python-files

2019-01-27 Thread Alan Gauld via Tutor
On 27/01/2019 14:57, Asad wrote: > print("first:", args.first) > print("second:", args.second) > > When I execute the script it gives error : > > python python_json_20001_oratest_v1.py "file1" > ('first:', 'file1') > ('second:', None) Note that the second file is None. > Traceback (most recent

Re: [Tutor] python-files

2019-01-27 Thread Peter Otten
Asad wrote: > Hi All , > > I tried the following code : > > parser = argparse.ArgumentParser() > parser.add_argument("first") > parser.add_argument("second", nargs="?") > args = parser.parse_args() > print("first:", args.first) > > print("second:", args.second) > > When I execute th

Re: [Tutor] python-files

2019-01-27 Thread Asad
Hi All , I tried the following code : parser = argparse.ArgumentParser() parser.add_argument("first") parser.add_argument("second", nargs="?") args = parser.parse_args() print("first:", args.first) print("second:", args.second) When I execute the script it gives error : python pytho

Re: [Tutor] Web scraping using selenium and navigating nested dictionaries / lists.

2019-01-27 Thread mhysnm1964
Peter, I am aware that I am avoiding functions that can make my life easier. But I want to learn some of this data structure navigation concepts to improve my skills in programming. What you have provided I will review in depth and have a play with. A big thanks. -Original Message- From

Re: [Tutor] Web scraping using selenium and navigating nested dictionaries / lists.

2019-01-27 Thread mhysnm1964
Marco, Thanks. The reason for learning selenium is for the automation. As I want to test web sites for keyboard and mouse interaction and record the results. That at least is the long term goal. In the short term, I will have a look at your suggestion. From: Marco Mistroni Sent: Sun

Re: [Tutor] Web scraping using selenium and navigating nested dictionaries / lists.

2019-01-27 Thread Peter Otten
mhysnm1...@gmail.com wrote: > All, > > > > Goal of new project. > > I want to scrape all my books from Audible.com that I have purchased. > Eventually I want to export this as a CSV file or maybe Json. I have not > got > that far yet. The reasoning behind this is to learn selenium for my wo

Re: [Tutor] Web scraping using selenium and navigating nested dictionaries / lists.

2019-01-27 Thread Marco Mistroni
Hi my 2 cents. Have a look at scrapy for scraping.selenium is v good tool to learn but is mainly to automate uat of guis Scrapy will scrape for you and u can automate it via cron. It's same stuff I am doing ATM Hth On Sun, Jan 27, 2019, 8:34 AM All, > > > > Goal of new project. > > I want to scr

Re: [Tutor] python - files

2019-01-27 Thread Cameron Simpson
On 27Jan2019 10:30, Peter Otten <__pete...@web.de> wrote: Cameron Simpson wrote: Mats has mentioned the modules getopt and argparse etc. These are primarily aimed at option parsing ("-v", "-o foo"). Your situation occurs _after_ the option parsing (in your case, there are no options). Not argp

Re: [Tutor] python - files

2019-01-27 Thread Peter Otten
Cameron Simpson wrote: > Mats has mentioned the modules getopt and argparse etc. These are > primarily aimed at option parsing ("-v", "-o foo"). Your situation > occurs _after_ the option parsing (in your case, there are no options). Not argparse. The main advantage over optparse is its handling

[Tutor] Web scraping using selenium and navigating nested dictionaries / lists.

2019-01-27 Thread mhysnm1964
All, Goal of new project. I want to scrape all my books from Audible.com that I have purchased. Eventually I want to export this as a CSV file or maybe Json. I have not got that far yet. The reasoning behind this is to learn selenium for my work and get the list of books I have purchased. Ki