Web scraping with regular expressions [Technical Blog]
Posted: 18 Jan 2013
Updated: 18 Jan 2013
Views: 1,523
Rating: 0.0 / 5
Votes: 0
Popularity: 0.0
Licence: The Code Project Open License (CPOL)
Bookmarked: 2
Downloaded: 0
Using regular expressions for web scraping is sometimes criticized, but I believe they still have their place, particularly for one-off scrapes. Let's say I want to extract the title of a particular webpage - here is an implementation using BeautifulSoup, lxml, and regular expressions:import reimpor