Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def save_content():
- url = input("Input the URL:")
- r = requests.get(url)
- if r.status_code == 200:
- page_content = requests.get(url).content
- # with open('..stage4/source.html', 'wb') as file:
- with open('C:/Users/linyu/Documents/jetbrains_temp_files/WebScraper/stage4', 'wb') as file:
- file.write(page_content)
- print("Content saved.")
- else:
- print(f"The URL returned {r.status_code}!")
- save_content()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement