aahouzi / Instagram-Scraper-2021

Scrape Instagram content and stories, using a new technique based on the har file (No Token + No public API).
MIT License
111 stars 12 forks source link

Can't retrieve any story #13

Closed kevbdx closed 2 years ago

kevbdx commented 2 years ago

Hey! First of all, this seems to be an amazing tool! I've downloaded the story scraper. I can't scrap any story, I tried with many usernames.

Here are the errors:

[SUCCESS]: Got into the story link.

Traceback (most recent call last):
  File "c:\Users\Kevin\Desktop\IG Scraper\insta_story_scraper.py", line 64, in <module>
    driver.find_element_by_xpath("/html/body/div[1]/section/div[1]/div/section/div/div[1]/div/div/div/div[3]/button").click()
  File "C:\Users\Kevin\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 394, in find_element_by_xpath
    return self.find_element(by=By.XPATH, value=xpath)
  File "C:\Users\Kevin\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 976, in find_element
    return self.execute(Command.FIND_ELEMENT, {
  File "C:\Users\Kevin\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "C:\Users\Kevin\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"/html/body/div[1]/section/div[1]/div/section/div/div[1]/div/div/div/div[3]/button"}

Thank you!

ghost commented 2 years ago

Thank u for the info. As u can see, the code wasn't maintained for over a year, so it was a good opportunity for me to get back to it, and introduce some changes. Now, it works fine and u can also download the scraped content. I tried with multiple usernames, I took a sreenshot of the last example:

Screenshot 2022-08-22 at 16 18 37 Screenshot 2022-08-22 at 16 21 19

I hope it helps you. I'll also do a code review for the feed and hashtag scraping in the next days.