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

Concerning making sure about getting into the welcome page #8

Closed yunhwankim2 closed 3 years ago

yunhwankim2 commented 3 years ago

Hi. It seems the code (insta_feed_scraper.py) entered into infinite loop when I tried to run it, and I found it was likely due to the part below (line 298).

            # Make sure that we get into the welcome page
            while True:
                driver.get(main_url)
                time.sleep(3)
                try:
                    if driver.find_element_by_xpath("/html/body/div[1]/section/main/div/header/section/div[1]/h2"):
                        print(colored("\n[SUCCESS]: Got into the user page. \n", "green"))
                        break
                except NoSuchElementException:
                    pass

The code tries to find "/html/body/div[1]/section/main/div/header/section/div[1]/h2" but it doesn't exist. Could you tell me what element the code is supposed to find? My guess is that it tries to find the user (account) name part. If my guess is correct, should the "h2" in the last be replaced with "h1"? Thank you in advance.

yunhwankim2 commented 3 years ago

I downloaded the code again, and it seems work. I'll keep trying find out what was wrong. Thank you anyway.