(python) selenium selector (multi elements)

There is scrapable library "BeautifulSoup"
Selenium is almost same with "BeautifulSoup" but the difference is that Selenium can "DOM" attrubute in dynamic wep page.

I will show you some example.

ex)
1. driver.find_element_by_css_selector("#content")
2. driver.find_element_by_tag_name("div")

If you have to select multi attribute not a single.
you can use "elements" ( append character "s" above element of two example)
the result value type is "LIST"


ex)
1. driver.find_elements_by_css_selector("#content)
2. driver.find_elements_by_css_selector("div")




댓글

이 블로그의 인기 게시물

(Garbage Collection) Old Area의 Concurrent Mark-sweep 알고리즘

(데이터베이스) HAVING절과 WHERE 절의 차이

(Pytorch) DataLoder 클래스