(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")




댓글

이 블로그의 인기 게시물

(18장) WebSocekt과 STOMP를 사용하여 메시징하기

(네트워크)폴링방식 vs 롱 폴링방식

(ElasticSearch) 결과에서 순서 정렬