Copy And Paste Text From Webpage To Txt File Or Csv File
I am trying to copy text from a webpage and paste it into a text file. Nothing too fancy but I can't seem to figure out how to do it or find anything online that works. import req
Solution 1:
Try encoding your text as utf-8
import requests
url = 'https://seekingalpha.com/article/4166013-t-t-q1-2018-results-earnings-call-transcript?part=single'
data = requests.get(url)
with open('file.txt','w') as out_f:
out_f.write(data.text.encode('utf-8'))
Post a Comment for "Copy And Paste Text From Webpage To Txt File Or Csv File"