본문 바로가기

Footstep . 발자취

Web Crawling with python(requests, BeautifulSoup)

 

import requests

from bs4 import BeautifulSoup

 

req = requests.get("https://www.naver.com/")

html = req.text

soup = BeautifulSoup(html, "html.parser")

tag = soup.select(

'span, [class=ah_k]' )

#print(tag)



for search in tag:

print(search.text)



It's my shit codes.

 

I'm trying to extract the context that I wanted to find.

 

but I screwed up continuously..

 

sometimes it works..

 

sometimes it doesn't work haha..

 

hopefully, I find the way to do that well




anybody help me!

'Footstep . 발자취' 카테고리의 다른 글

2020-02-05-My footstep  (0) 2020.03.16
2020-02-04-My footstep  (0) 2020.03.16
Java class version error in vscode  (0) 2020.03.16
My footstep 2020/02/3  (0) 2020.03.16
Direction  (0) 2020.03.16