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

There's more...

This manner of navigating the DOM is relatively inflexible and is highly dependent upon the structure. It is possible that this structure can change over time as web pages are updated by their creator(s). The pages could even look identical, but have a completely different structure that breaks your scraping code.

So how can we deal with this? As we will see, there are several ways of searching for elements that are much better than defining explicit paths. In general, we can do this using XPath and by using the find methods of beautiful soup. We will examine both in recipes later in this chapter.

主站蜘蛛池模板: 泸西县| 策勒县| 昌邑市| 沈丘县| 安塞县| 岗巴县| 贵南县| 和政县| 张掖市| 龙里县| 滨州市| 太原市| 徐水县| 普洱| 大英县| 喀喇沁旗| 齐齐哈尔市| 扎赉特旗| 牟定县| 丰城市| 辽源市| 吴旗县| 永清县| 衡南县| 新乐市| 宜州市| 永仁县| 阿荣旗| 哈尔滨市| 东乌| 磐石市| 漯河市| 碌曲县| 白水县| 峨山| 北宁市| 太康县| 郁南县| 巫山县| 边坝县| 西乌珠穆沁旗|