Open alv67 opened 3 years ago
smth like this?
import requests
from bs4 import BeautifulSoup as bs
url = 'https://www.packtpub.com/product/hands-on-application-development-with-pycharm/9781789348262'
r = requests.get(url)
s = bs(r.text, features='lxml')
for i in s.find_all('a', href=True):
if 'https://github.com/packtpublishing' in i['href']:
print(f"found url: {i['href']}")
As an example in https://www.packtpub.com/product/hands-on-application-development-with-pycharm/9781789348262 there is a "Download code from GitHub". I need to check for each book if a link is present and in that case add this information to the README.md of the book