Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexError: list index out of range - Video post #4

Closed
laurent-d opened this issue Apr 11, 2017 · 13 comments
Closed

IndexError: list index out of range - Video post #4

laurent-d opened this issue Apr 11, 2017 · 13 comments

Comments

@laurent-d
Copy link

Hi @timgrossmann

Thanks for your amazing work !!!
For some obvious reason your app stop to work since there are videos posts ..
The error is img = imgs[1].get_attribute('src')
IndexError: list index out of range

Do you have an idea about this issue ?
Regards

Laurent

@timgrossmann
Copy link
Collaborator

@laurent-d Hmm... well it works when crawling my own profile which also has videos.
Could you give me an username for which this error will occur?

@laurent-d
Copy link
Author

Thanks @timgrossmann !
I tried with your profile.
I use the last version of Selenium 3.33 for Mac.
Please see below

MacBook-Pro-de-Laurent:instagram-profilecrawl laurentdelacerda$ python3.5 crawl_profile.py grossertim
Extracting information from grossertim

  • Could not get information from post: https://www.instagram.com/p/BSHUbpSF61n/?taken-by=grossertim
    Traceback (most recent call last):
    File "crawl_profile.py", line 20, in
    information = extract_information(browser, username)
    File "/Users/laurentdelacerda/instagram-profilecrawl/util/extractor.py", line 117, in extract_information
    img, tags, likes, comments = extract_post_info(browser)
    File "/Users/laurentdelacerda/instagram-profilecrawl/util/extractor.py", line 34, in extract_post_info
    img = imgs[1].get_attribute('src')
    IndexError: list index out of range
    MacBook-Pro-de-Laurent:instagram-profilecrawl laurentdelacerda$

It stop when it arrive to video

@clbailey
Copy link

clbailey commented Apr 14, 2017

I'm getting the same error. @timgrossmann, which versions are you using for Python and Selenium?

I tried with Python 3.6.1 and Selenium 3.3.3 (edit: on MacOS 10.12). I'm not familiar with Python or Selenium, but I can try other tests if you have suggestions.

@nacimgoura
Copy link

nacimgoura commented Apr 15, 2017

Hi @clbailey ,
I was inspired by this project to make my own script in Javascript. If you know a little nodeJS and npm, you can test my program (https://github.com/nacimgoura/instagram-profilecrawl). There are still bugs but I fix them quickly.

@timgrossmann
Copy link
Collaborator

@laurent-d @clbailey This is really weird, there is no problem with videos for me... I actually covered that case in my script...

For the version information...
selenium (2.53.6)

Make sure to run it with:

python3.5 ...

@laurent-d
Copy link
Author

I tried without success same.. thanks for your support

@timgrossmann
Copy link
Collaborator

@laurent-d I'm really sorry you get that problems...
I will look into the code and try to fix it.

@laurent-d
Copy link
Author

laurent-d commented Apr 16, 2017

Hi @timgrossmann, @nacimgoura found a similar issue on his nodejs script (https://github.com/nacimgoura/instagram-profilecrawl) .
The language of the browser change the instagram display. My chrome is in french and not in english.
Hope it's the same issue and it helps you.

@timgrossmann
Copy link
Collaborator

@laurent-d Thank you, yes that's the problem. Thank you for pointing it out.

@timgrossmann
Copy link
Collaborator

@laurent-d Please pull the newest version and try again.

@khaeransori
Copy link

khaeransori commented Apr 19, 2017

@timgrossmann I still get this errror even when I already pull the newest version

I didn't see you're pushing new commits, your latest commit is 14 days ago

@timgrossmann
Copy link
Collaborator

@khaeransori

Update crawl_profile.py
timgrossmann committed on GitHub 3 days ago

@khaeransori
Copy link

khaeransori commented Apr 19, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants