크롤링 for 질문

크롤링 for 질문

작성일 2021.09.30댓글 1건
    게시물 수정 , 삭제는 로그인 필요

python3를 이용한 웹크롤링입니다.

h2 태그의 클래스 중
 {'class' : 'text-1 weight-semi line-tight margin-bottom-xxsmall'
 {'class' : 'course-name text-1 weight-semi line-tight margin-bottom-xxsmall'}
두개를 크롤링하고 싶어 웹페이지의 위에서 부터 차례대로

for i in html.findAll("h2", {'class' : 'text-1 weight-semi line-tight margin-bottom-xxsmall'}  {'class' : 'course-name text-1 weight-semi line-tight margin-bottom-xxsmall'}):
방식으로 하니 에러가 나서 질문드립니다.
두 속성중 하나라도 가지고 있으면 리스트에 담고 싶은데 for에 두개를 동시에넣으니 되지않아 질문드립니다.
다른 방법이 있나요?


#크롤링 for문

profile_image 익명 작성일 -

아래처럼 두개를 따로 찾아서 더하시면 될것 같아요.

for i in \ html.find_elements_by_class_name('text-1 weight-semi line-tight margin-bottom-xxsmall') + \ html.find_elements_by_class_name('course-name text-1 weight-semi line-tight margin-bottom-xxsmall'): pass

파이썬 크롤링 질문

... for i in range(1,3): path = f'#featured-results > ul > li:nth-child({i}) > div > div.card... 크롤링에 관련된 질문에 답변드리겠습니다. 주어진 코드에서 `element...

파이썬 웹크롤링 질문

... _prs_nws > ul > li") for article in articles: a_tag = article.select_one("a") title... a_tags ※ 질문주신 내용 이외에도, 웹크롤링과 관련하여 궁금한...

주피터 노트북 크롤링 질문합니다 ~

... g') #script1을 for문을 이용하여 pdf가 포함된 글만 추려냄 for i in result_1... count += 1 ※ 질문주신 내용 이외에도, 파이썬/웹크롤링과 관련하여...

크롤링 질문이요!!!!!!

... img_list = [ ] for j in img_src : img_src1 = j['src'] img_list.append(img_src1) 전체... 저장중" %file_no) ※ 질문주신 내용 이외에도, 웹크롤링과...