Skip to content Skip to sidebar Skip to footer

How To Get Words From A Online Txt Archive Such As Pastebin?

I'm new to coding/python and I'm trying to do a simple user checker with python but I don't know how to get the words from a www.site.com/mytextfile.txt or pastebin.com/raw/1111111

Solution 1:

In [1]: import requests # requests module of python (can be installed via pip)
    ...: url = 'https://pastebin.com/raw/nkGg7bFy' # url of paste
    ...: r = requests.get(url) # response will be stored from url
    ...: content = r.text  # raw text from url
    ...: print(content) # prints content
    ...:
user1
user2
user3
user4

Post a Comment for "How To Get Words From A Online Txt Archive Such As Pastebin?"