1. 程式人生 > >爬蟲定位器--Beautiful Soup和selenium用法大全

爬蟲定位器--Beautiful Soup和selenium用法大全

目錄

前言

Beautiful Soup

selenium


前言

最近爬蟲定位元素總是覺得力不從心,蒐集了幾篇文章的知識,以供參考。字尾名就是對於便籤的屬性,這些方法雖然不是最好的,但是寫一些小爬蟲來定位是沒問題的。

Beautiful Soup

           find()

           find_all()

           find_parent()

           find_parents()

           find_next_sibling()

           find_next_siblings()

           find_previous_sibling()

           find_previous_siblings()

           find_previous()

           find_all_previous()

           find_next()

           find_all_next()

selenium

          find_element_by_id   

          find_element_by_name

          find_element_by_xpath

          find_element_by_link_text

          find_element_by_partial_link_text

          find_element_by_tag_name

          find_element_by_class_name

          find_element_by_css_selector