![[파이썬]셀레니움을 이용한 특정부분만 하이라이트 적용](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2Fc5tisI%2Fbtq4gae0w8a%2FAAAAAAAAAAAAAAAAAAAAAJa3-fa0arbEUsol2Jgc6PaaJXYTsBmX2T4uTCPYozJG%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1756652399%26allow_ip%3D%26allow_referer%3D%26signature%3DbiIb4LDFGQpQgizJH%252BCt8zl0Fug%253D)
from selenium import webdriver driver = webdriver.Chrome('C:\\Users\\ryzen3\\Downloads\\chromedriver.exe') driver.get("https://darksharavim.tistory.com/") elements = driver.find_element_by_css_selector("#ttItem1547528381 > ul > li.tt-span-12.tt-last.tt-clear > div:nth-child(1)") driver.execute_script("arguments[0].style.backgroundColor = 'yellow'; return arguments[0];", elements) 참고 URL : www.py..
![[파이썬]unknown error: DevToolsActivePort file doesn't exist](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FG3xWK%2Fbtq3NIXPkDd%2FAAAAAAAAAAAAAAAAAAAAACA-yxu3Kgfw3KX9_xOasxcesDpsN9MG_1huv4Z17av9%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1756652399%26allow_ip%3D%26allow_referer%3D%26signature%3D4JuVxdOV20livE03uyzWQWewvu4%253D)
파이썬 실행시 아래와 같이 오류발생할 경우 unknown error: DevToolsActivePort file doesn't exist 아래내용 추가 from selenium import webdriver chrome_options = webdriver.ChromeOptions() chrome_options.add_argument('--headless') chrome_options.add_argument('--no-sandbox') chrome_options.add_argument("--single-process") chrome_options.add_argument("--disable-dev-shm-usage") driver = webdriver.Chrome("./chromedriver",chrome_..
![[파이썬]셀레니움을 이용해 geoip 업데이트 자동화](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2Fc1OSri%2Fbtq3RFkOvfI%2FAAAAAAAAAAAAAAAAAAAAAAdUYdh8jul73hur3lkEftYhIWiVGYpOPAAjzbVW-vVy%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1756652399%26allow_ip%3D%26allow_referer%3D%26signature%3D%252FMh38N9mmb0KmKO3XPzK3XcACWg%253D)
geoip을 업데이트 하기위해서는 로그인을 해서 최신버전을 그때 그때 다운로드를 받아야합니다. 사실 3개월정도에 한번 할까 말까라 좀 귀찮아서 자동화해볼려고합니다. 스타트~ 설치환경 centos7 1. python3 install [daraksharavim.tistory.com]$ yum -y install python3 [daraksharavim.tistory.com]$ yum install python3 [daraksharavim.tistory.com]$ pip3 install -U pip [daraksharavim.tistory.com]$ pip install beautifulsoup4 [daraksharavim.tistory.com]$ pip install selenium 2. chrome ins..
![[파이썬]beautifulsoup를 이용한 사이트 정보 추출](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FcWxbJk%2Fbtq3GEU6kuy%2FAAAAAAAAAAAAAAAAAAAAAALKTP6IQBMbdXHk7Rl9WcKWXiC2_inqaO9hwsad5icE%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1756652399%26allow_ip%3D%26allow_referer%3D%26signature%3DckGkD2stawR0G2cVRVpTU9MxRqs%253D)
1. beautifulsoup 설치 $ pip install beautifulsoup4 2. beautifulsoup 사용법 import requests from bs4 import BeautifulSoup url = 'https://darksharavim.tistory.com/' response = requests.get(url) if response.status_code == 200: html = response.text soup = BeautifulSoup(html, 'html.parser') print(soup) else: print(response.status_code) 상태값이 200인 경우만 출력 C:\Users\kajin7-ryzen3\PycharmProjects\darksharavim\v..
설치환경 : centos7 파이썬3.6설치 [daraksharavim.tistory.com]$ yum -y install https://centos7.iuscommunity.org/ius-release.rpm [daraksharavim.tistory.com]$ yum -y install python36u python36u-libs python36u-devel python36u-pip [daraksharavim.tistory.com]$ ln -s /bin/python3.6 /bin/python3 [daraksharavim.tistory.com]$ ln -s /bin/pip3.6 /bin/pip [daraksharavim.tistory.com]$ pip install --upgrade pip [daraksh..