Python Forum
Please help me condense this requests snippet, and answer a basic question
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Please help me condense this requests snippet, and answer a basic question
#1
I'm having a hard time deciphering the requests module documentation, so is there a way to do this in one statement:

// assume I've imported requests and defined variable url with a string value representing
// a valid url

raw_object = requests.get(url)
extracted_text = raw_object.text
Also, when I use dir() on a requests.response object, I get a list of attributes and methods. Does that list vary depending on the data retrieved from the webpage accessed by requests.get(), or on different operating systems the running Python is installed on, provided that the version of Python is the same?
Reply


Messages In This Thread
Please help me condense this requests snippet, and answer a basic question - by league55 - Jan-28-2018, 08:43 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  POST requests - different requests return the same response Default_001 3 2,059 Mar-10-2022, 11:26 PM
Last Post: Default_001

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020