You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
458 B
26 lines
458 B
import requests
|
|
|
|
url = 'https://codeforces.com/search?by='
|
|
|
|
name = input()
|
|
|
|
params = {
|
|
'query' : name
|
|
}
|
|
|
|
headers = {
|
|
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 Edg/125.0.0.0'
|
|
}
|
|
|
|
response = requests.get(url=url, params=params, headers=headers)
|
|
|
|
page_text = response.text
|
|
|
|
File = name + '.html'
|
|
|
|
with open(File, 'w', encoding='utf-8') as fp:
|
|
fp.write(page_text)
|
|
|
|
|
|
|