Web crawler, python

https://beomi.github.io/2017/01/20/HowToMakeWebCrawler/
https://beomi.github.io/2017/02/27/HowToMakeWebCrawler-With-Selenium/

\> pip install requests
import requests

req = requests.get('https://www.melon.com/chart/index.htm')
html = req.text
header = req.headers
status = req.status_code
is_ok = req.ok
\> pip install bs4
import requests
from bs4 import BeautifulSoup

# HTTP GET Request
req = requests.get('https://www.melon.com/chart/index.htm')
html = req.text
soup = BeautifulSoup(html, 'html.parser')
titles = soup.select("div.ellipsis.rank01 > span > a")
for title in titles:
    print(title.text)


© 2018. All rights reserved.

Powered by Hydejack v8.4.0