Questions tagged as 'python-requests'

2
answers

How to define a header with a JWT token in a request made by the Requests library?

I am using the Requests Python library to make HTTP requests. I was able to make a post request quietly in order to get a JWT token. But now I need to send this token through a header, but I have no idea how to do it. The code I cur...
asked by 27.10.2016 / 13:58
1
answer

preApproval data is required

Currently, I am trying to integrate a prepayment via v2 from api to pagseguro. For some reason I keep getting pre-approval data is required. I tried chaning the headers, I was also checking the example in the documentation and did not seem to be...
asked by 17.02.2017 / 02:12
1
answer

Check url after request

How do I make my code check which url / link is in?    My code: import requests as r from bs4 import BeautifulSoup as bs import time import os clear = lambda: os.system('cls') clientes1 = 0 clientes2 = 0 ok = [] req = r.get('https://www...
asked by 18.05.2018 / 15:42
3
answers

JSON does not return utf-8

I'm using freegeoip to know my location and use it in my program, but when I make a call using: r = requests.get(location_url, headers={"content-type":"application/json;charset=UTF-8"}) The return looks like this: { ip: "0.0.0.0", cou...
asked by 10.07.2017 / 18:10
2
answers

Submit form in python

I'm trying to submit a form on link , but I've already tried several ways here in stackoverflow of how to submit a form, and found no way to solve this problem. This is a code sample I took here in the forum and it did not work. import...
asked by 22.12.2017 / 14:30
0
answers

how to capture specific tokens in python requests

I need to catch specific cookies from a python code and pass them on afterwards, the problem is, if I set the cookies manually they work for a while but after a few days they expire. I can get a recursive token with the cookie = requests.cookies...
asked by 09.08.2018 / 15:58
1
answer

requests.exceptions.SSLError: certificate verify failed

I'm having a big problem with Django requests. In the last few months I've upgraded to Django 2.0, and I'm updating all the libs. I noticed that this impacted on a number of scripts I had, mostly those that talk to https. For example, my Push...
asked by 30.05.2018 / 17:51
0
answers

How to get only one Json value using request.get_data () Flask Python

I'm a beginner in Python and would like a tip to get only one value from the following Json. { "test1":"valortest1", "test2":"valortest2", "test3":"valortest3", "test1":"valortest1" } Use to get json as follows in flask. given = req...
asked by 16.06.2017 / 22:42
1
answer

Requests, BeautifulSoup Tables

I have a website that I want to extract specific data from a table Iwanttoextractalltheinformationthathas"PROLONG" element. My difficulty is that all tables have the same name in the "class" class="field". how do I extract the data related t...
asked by 10.05.2018 / 01:21
1
answer

Website with hidden HTML

I need to extract the sales data for new cars on some websites. One of the sites is the Locamerica company. However, on her site does not appear in the page HTML content that I need to extract. I need to extract the data of each car pres...
asked by 19.05.2018 / 23:29