from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from webdriver_manager.chrome import ChromeDriverManager
driver = webdriver.Chrome(ChromeDriverManager().install())
try:
for i in range(1,11):
url = 'https://naver.com/BlogHome.nhn?directoryNo=0¤tPage='+str(i)+'&groupId=0'
driver.get(url)
elem = driver.find_element_by_class_name('list_post_article')
print(elem.text)
input()
except Exception as e:
print(e)
finally:
driver.quit()
네이버 블로그 크롤링
네이버 기사 메인 화면 호출
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from webdriver_manager.chrome import ChromeDriverManager
driver = webdriver.Chrome(ChromeDriverManager().install())
try:
driver.get('http://pann.nate.com')
elem = driver.find_element_by_id('container')
lis = elem.find_elements_by_xpath('./div/ul')
for li in lis:
print(li.text)
input()
except Exception as e:
print(e)
finally:
driver.quit()
네이트 판 메인 화면 호출
'HTML > HTML' 카테고리의 다른 글
[HTML] HREF 란? (0) | 2023.02.16 |
---|---|
[HTML] Button text 바꾸기 (0) | 2022.09.16 |
[HTML] 왜 HTML은 Programming Language가 아닌가? (0) | 2022.08.19 |
[Python_HTML] 예제 - 웹 자동 검색 (0) | 2021.03.04 |
댓글