Tag python-requests

[Solved] Why is my parser not working

The text you are looking for is in the 2nd TR inside the table. So, print tbl.findAll(‘tr’)[2] There really isn’t any good structure inside that text, however, so you’re on your own about getting the contact name, etc. solved Why…

[Solved] Python – var = var = var value

Use a dictionary, not variables. If you have variable names, the way to get the variable contents is evil, and almost always there is a better way. In this case: server_connection_commands = { “AdminServer”: “putty.exe -ssh 1.1.1.1”, “Server1”: “putty.exe -ssh…

[Solved] Unable to communicate with API

CONCLUSION – 07-25-2021 After looking at this problem in more detail, I believe that it is NOT technically possible to use Python Requests to scrape the website and table in your question. Which means that your question cannot be solved…

[Solved] PlayerDB API Post Requests bring 404

If you are getting error messages from the API like this: {“message”: “”, “code”: “api.404”, “data”: {}, “success”: false, “error”: false} try requesting each UUID seperately and once you have gotten a good response, try running it with your program.…

[Solved] How to use python-request to post a file on a Rails App

I figured it out: def add_photo(entry_id, image_path): return requests.post( url = URL, headers = HEADER, files = { ‘entry[entry_id]’: (None, entry_id, ‘text’), ‘entry[photo]’: (os.path.basename(image_path), open(image_path, ‘rb’), ‘image/jpg’, {‘Expires’: ‘0’}) } ) solved How to use python-request to post a file…

[Solved] Bad Request in Python

maybe this will help import requests city = input(“What is the name of the city?: “) url= “http://api.openweathermap.org/data/2.5/weather?q={city}&appid=*************”.format(city=city) response = requests.get(url) print(response) 2 solved Bad Request in Python

[Solved] Python and curl equivalent

Solved mydata = {’email’: form.vars.email, ‘password’:form.vars.password} resp= requests.post(‘url’, json = mydata) I don’t know why but I had already tried it and it didn’t work solved Python and curl equivalent