Skip to content

Instantly share code, notes, and snippets.

@no1xsyzy
Created December 7, 2021 01:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save no1xsyzy/06134c7ede6780c8446b33edc6b06e3b to your computer and use it in GitHub Desktop.
Save no1xsyzy/06134c7ede6780c8446b33edc6b06e3b to your computer and use it in GitHub Desktop.
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