I am trying to use python to scrape a website implemented with infinite scroll. Actually, the web is pinterest. I know how to use selenium webdriver to scrape a web with infinite scroll. However, the webdriver basically imitates the process of visiting the web and is slow, much slower than using BeautifulSoup and urllib for scraping. Do you know any time efficient ways to scrape a web with infinite scroll? Thanks.
The infinite scroll is probably using an Ajax query to retrieve more data as you scroll. Use your browser's dev tools to inspect the request structure and try to hit the same endpoint directly. In this way you can get the data you need, often in json or xml format. 
In chrome open the dev tools (Ctrl + shift + I  in windows) and switch to the network tab. Then begin to scroll, when more content is loaded you should see new network activity. Specifically a Ajax request, you can filter by "xhr". Click on the new network item and you will get detailed info on the request such as headers, the request body, the structure of the response, and the url (endpoint) the request is hitting. Scraping this url is the same as scraping a website except there will be no html to parse through just formatted data.
Some websites will try to block this type of behavior. If that happens I suggest using phantomjs without selenium. It can be very fast (in comparison to selenium) for mimicking human interaction on websites.
Is there any fast ways to scrape a website with infinite scroll?