- Python Web Scraping Cookbook
- Michael Heydt
- 46字
- 2025-02-26 12:46:23
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)
...: