MatthewChatham / glassdoor-review-scraper

Scrape reviews from Glassdoor
BSD 2-Clause "Simplified" License
180 stars 252 forks source link

TypeError: list indices must be integers or slices, not str #7

Closed pyGideon closed 5 years ago

pyGideon commented 5 years ago

Hi, I am getting below mentioned error while running "python main.py --headless -u https://www.glassdoor.co.in/Overview/Working-at-Tesla-EI_IE43129.11,16.htm -l 2300 -f tesla_reviews.csv" I have already created Json file 'secret.json'

Traceback (most recent call last): File "main.py", line 90, in args.username = d['username'] TypeError: list indices must be integers or slices, not str

It will be really appreciated if you could look at this and suggest how to resolve it.. TIA!

pyGideon commented 5 years ago

I have saved secret.json file with the following content: [ { "username": "value1", "password": "value2" } ] Let me know if any changes are required in this..

pyGideon commented 5 years ago

Solved this error: Don't use square brackets in json file as it was read as list, instead define as { "username": "value1", "password": "value2" }