官术网_书友最值得收藏!

Getting ready

The code for these snippets is in 02/03_lxml_and_xpath.py in case you want to save some typing.  We will start by importing html from lxml, as well as requests, and then load the page.

In [1]: from lxml import html
...: import requests
...: page_html = requests.get("http://localhost:8080/planets.html").text
By this point, lxml should be installed as a dependency of other installs.  If you get errors, install it with pip install lxml.
主站蜘蛛池模板: 象州县| 含山县| 宜州市| 黔西| 浑源县| 陕西省| 炎陵县| 敦化市| 遂昌县| 罗源县| 辽宁省| 社旗县| 乌兰察布市| 孟州市| 沙洋县| 华安县| 奉贤区| 沂水县| 尼玛县| 崇仁县| 吴堡县| 巴中市| 灵石县| 枝江市| 景东| 碌曲县| 宜章县| 巩留县| 清河县| 土默特左旗| 滨海县| 岚皋县| 枝江市| 平阳县| 噶尔县| 潜江市| 陵水| 微博| 卫辉市| 友谊县| 海阳市|