- Python Web Scraping Cookbook
- Michael Heydt
- 46字
- 2021-06-30 18:44:02
Getting ready
Let's start examining CSS selectors using the same start up code we used in the last recipe. These code snippets are also in the 02/04_css_selectors.py.
In [1]: from lxml import html
...: import requests
...: page_html = requests.get("http://localhost:8080/planets.html").text
...: tree = html.fromstring(page_html)
...: