Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

write page source to text file python

import requests

url = "https://stackoverflow.com/questions/24297257/save-html-of-some-website-in-a-txt-file-with-python"

r = requests.get(url)
with open('file.txt', 'w') as file:
    file.write(r.text)
Comment

PREVIOUS NEXT
Code Example
Python :: django file upload this field is required 
Python :: pandas transpose 
Python :: case in python 
Python :: jupyter upload folder 
Python :: reverse text python 
Python :: python take the month of date in new column 
Python :: python remove none from dict 
Python :: get string until character python 
Python :: how to delete all item in treeview tkinter 
Python :: ImportError: No module named flask 
Python :: AttributeError: __enter__ python 
Python :: pandas add column with constant value 
Python :: Simple pagination wrapper for discord.py. 
Python :: cv2.threshold binary 
Python :: python cut string after character 
Python :: python replace accented characters code 
Python :: python random integer in range 
Python :: dataframe pandas to spark 
Python :: pip install google cloud secret manager 
Python :: django ckeditor not working 
Python :: relu function python 
Python :: finding the Unique values in data 
Python :: assignment 7.1 python data structures 
Python :: mac catallina python3 
Python :: csrf token fetch django 
Python :: how to switch driver in python selenium 
Python :: replace df with 
Python :: define empty numpy array 
Python :: when was python created 
Python :: how to check if a cell is empty in openpyxl 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =