I actually just wrote a complete web cleaning guide that includes sample code in Python. I wrote and tested on Python 2.7, but both the packages I used (queries and BeautifulSoup) are fully compatible with Python 3 according to the Wall of Shame .
Here is some code to get you started with web scraping in Python:
import sys import requests from BeautifulSoup import BeautifulSoup def scrape_google(keyword):
If you just want to learn more about Python 3 in general and are already familiar with Python 2.x, then this article about switching from Python 2 to Python 3 can be useful.
source share