Created
September 26, 2017 14:55
-
-
Save xeon-zolt/fb3a0d6e953dcdcc6ca3c5b23c6cc00d to your computer and use it in GitHub Desktop.
url fetching from https://www.codechef.com/wiki/tutorials
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
#! /usr/bin/env python3 | |
from bs4 import BeautifulSoup | |
import requests | |
url = "https://www.codechef.com/wiki/tutorials" | |
response = requests.get(url) | |
soup = BeautifulSoup(response.content, "html.parser") | |
for anchor in soup.findAll('a', href=True): | |
if 'freelinking' in anchor['href']: | |
print ('https://www.codechef.com'+anchor['href']) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment