Changes between Version 3 and Version 4 of en/ProgrammingRobotsCourse/GettingWwwInfo
- Timestamp:
- Oct 28, 2019, 4:31:50 PM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
en/ProgrammingRobotsCourse/GettingWwwInfo
v3 v4 22 22 (Full example attachment:forecast.py) 23 23 24 === Parse webpage data 25 24 26 If no API is provided, you can download and parse the webpage. 25 27 28 {{{#!python 29 from bs4 import BeautifulSoup 30 import requests 31 page = requests.get(url).text 32 soup = BeautifulSoup(page, features="lxml") 33 results = soup.findAll('h2', attrs={'class':'article-title'}) 34 }}} 35 36 (Full example attachment:news.py)