Created
August 18, 2018 22:35
-
-
Save kirussian911/5f7e99a9bd431fb01f48bb89f413a0b0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup as BS | |
def get_html(url): | |
r = requests.get(url) | |
return r.text | |
def get_data(html): | |
soup = BS(html, 'html.parser') | |
title = soup.findChildren('h2', {'class':'entry-title'}).text | |
return title | |
def main(): | |
url = 'https://aliholic.com/shop/page/1/' | |
print(get_data(get_html(url))) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment