Hi everyone, I'm trying to use selenium and scrapy to scrape some information from https://answers.yahoo.com/dir/index/discover?sid=396545663
I try another method, I use Selenium and install PhantomJs as a driver. To scroll a page, this is an endless scroll page, I use this instruction:
elem.send_keys(Keys.PAGE_DOWN)
To simulate a click on the Down button instead of a JavaScript function:
browser.execute_script("window.scrollTo(0, document.body.scrollHeight);")
Because this "seems" loads fewer elements on the page.
Main problem is how can I find out when I reached the bottom of the page? Is the page "Infinite scroll", so I can not know when it will end, I need to scroll down, but I do not have an element at the bottom for analysis.
I actually use a time loop, but I look really stupid.
thanks
source
share