본문 바로가기

IT 개발 프로그래밍/파이썬

(8)
파이썬 AttributeError: module 'collections' has no attribute 'MutableMapping' 에러 해결 pyrebase를 github action 에서 사용 해야했다. workflow 파일에 import pyrebase를 적어넣었는데 이러한 오류가 발생했다. 그대로 구글에 긁어서 검색해보니 스택오버플로도 들어가보고 했지만 나에게 맞는 해결책이 나오지않았고 사진에있는 두번째 링크 깃헙 이슈에 들어가보니 젤 간단한 해결책이어서 바로 시도 pip install uplink 를 써주니 길고 길던 오류메시지가 훨씬 간략해짐 jwt 라는 모듈 없으니 설치해라 정도 그냥 pip install 설치 모듈 옆에 jwt 추가해주고 그리고 repybase 써주니 오류 없이 모든 모듈 설치 성공!
크롬 버전 자동업데이트로 인한 compatibility 문제 크롬버전은 자동으로 계속 업데이트 되는데 드라이버는 버전이 똑같다 보니 호환성 문제 생김 그래서 드라이버 다시 깔고 호환시킨 후 크롬 자동업데이트 못하게 하기로함.
hinative 1번째 질문 목록 from selenium import webdriver driver=webdriver.Chrome('C:\Chrome_Driver\chromedriver.exe') driver.get('https://hinative.com/en-US/users/sign_in') driver.find_element_by_name('user[login]').send_keys('') driver.find_element_by_name('user[password]').send_keys('') driver.find_element_by_xpath('//*[@id="new_user"]/input[4]').click() from bs4 import BeautifulSoup def get_questions(): questions=[] d..
Hinative 로그인 하기 from selenium import webdriver driver=webdriver.Chrome('C:\Chrome_Driver\chromedriver.exe') driver.get('https://hinative.com/en-US/users/sign_in') driver.find_element_by_name('user[login]').send_keys('') driver.find_element_by_name('user[password]').send_keys('') driver.find_element_by_xpath('//*[@id="new_user"]/input[4]').click()
파파고에 문장 번역시키기 https://book.coalastudy.com/data-crawling/week-6/challenge-1 과제 코드 from selenium import webdriver driver=webdriver.Chrome('C:\Chrome_Driver\chromedriver.exe') driver.get('https://papago.naver.com/') driver.find_element_by_id('txtSource').send_keys('i love koala study') driver.find_element_by_xpath('//*[@id="btnTranslate"]').click()
자동 로그인 및 주요 정보 추출하기
파이썬 연속적인 크롤링하기 import requests from bs4 import BeautifulSoup class Conversation: def __init__(self, question, answer): self.question=question self.answer=answer def __str__(self): return "질문: " +self.question + "\n답변: " + self.answer + "\n" def get_subjects(): subjects=[] req=requests.get('https://basicenglishspeaking.com/daily-english-conversation-topics/') html=req.text soup=BeautifulSoup(html, 'html.parser'..
파이썬 공지사항 크롤링 하기 import requests from bs4 import BeautifulSoup # 특정 url에 접속하는 요청(Request) 객체를 생성합니다. request=requests.get("http://www.dowellcomputer.com/main.jsp") # 접속한 이후의 웹 사이트 소스코드를 추출합니다. html=request.text # HTML 소스코드를 파이썬 객체로 변환합니다. soup=BeautifulSoup(html, 'html.parser') # 태그 포함하는 요소를 추출합니다. links=soup.select('td > a') # 모든 링크에 하나씩 접근합니다. for link in links: #링크가 href 속성을 가지고있다면 if link.has_attr('href'): #..