-
-
Save no1xsyzy/06134c7ede6780c8446b33edc6b06e3b 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 | |
headers = { | |
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0', | |
} | |
response = requests.get('https://www.minecraft.net/en-us/download/server/bedrock', headers=headers) | |
response.encoding = response.apparent_encoding | |
bs = BeautifulSoup(response.content, 'lxml') | |
hyperlink = bs.find(attrs={'aria-label': "Download Ubuntu Server software for Ubuntu"}) | |
url = hyperlink.attrs['href'] | |
print(url) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment