Questions tagged as 'python-requests'

1
answer

TypeError: POST data should be bytes, an iterable of bytes, or a file object. It can not be of type str

I'm trying to translate a code from Python 2.7 to 3.6 Code 2.7 works perfectly: from urllib2 import Request, urlopen values = """ { "exchange_code": "PLNX", "exchange_market": "BTC/USDT" } """ headers = { 'Content-Type': 'ap...
asked by 21.03.2017 / 00:23
1
answer

Error every time I do a Requests Flask

When I make a request from an Api to show the number of players in my template where "For in range (200)" it returns the data and not the error. <table class="cor"> <tr class="fundo"> <th>T...
asked by 01.05.2018 / 22:40
1
answer

Iterating web pages using Requests and Python

I am a beginner in web scraping. How to learn how to make a database from data on selling new cars on some websites. One of the sites eh esse url = https://www.seminovosunidas.com.br/veiculos/page:1?utm_source=afilio&utm_medium=display&...
asked by 19.05.2018 / 07:32
1
answer

how to handle a json that contains multiple results using python

Hello, I'm doing a python script that takes the name of a movie and returns some data to the user (title, year etc). I'm using api omdbapi, but my question is not with regards to it but how to handle the following json link , when I use the par...
asked by 18.01.2018 / 23:52
2
answers

I can not import any Python module

I want to import the requests module from Python into a program I am doing, but it does not stop giving the following error, as soon as I run the program: ModuleNotFoundError: No module named 'requests' I have the latest version of P...
asked by 02.08.2017 / 18:12
1
answer

Requests not being sent with payload in Python - Moodle

Good afternoon, I have a problem that is already giving a certain headache. The blessed payload of the request is not being sent to the webservice, only to the url. My code looks like this: class Curso: '''Resgata todas as disciplinas mo...
asked by 27.10.2018 / 22:18
0
answers

Send multiple parameters in Scrapy formdata

Hello, I'm using Scrapy to automate a "query" process on a website. After logging into a site, using FormRequest , I need to make a new request to send several process numbers to the site. I'm currently doing this: d...
asked by 15.10.2018 / 14:24
0
answers

POST method on DONTPAD.COM

Hello, I am creating a bot that daily updates a repository on dontpad.com I used requests but when trying to insert the text, the code simply clears the page and inserts nothing! Just turn it off! import requests url = 'http://dontp...
asked by 18.09.2018 / 16:54
0
answers

How to sum values from a request:

Example: request = requests.get('https://api.amountofsomething.com') quantidade = requisição.json()['amount'] This request returns the quantity, for example: {[{25}{120}{158}{0}{2}{10}]} I need to add values without patterns. I tr...
asked by 09.08.2018 / 05:06
0
answers

Result of paged rather than unified loop

I'm having trouble getting a formatted result in paged JSON. My code instead of returning the result of the bound, is bringing the result per page! import requests def __init__(self, usuario, token): self.usuario = usuario self.token...
asked by 07.06.2018 / 01:18