All Questions
82 questions
0
votes
0
answers
410
views
Python & Beautiful Soup/Requests: request return a byte string - how to decode?
Short version: Scraping two very similar web pages, but the content of one is returned as a byte stream.
Long version: I am just dipping my toes into Beautiful Soup. And I am testing on two web pages;...
0
votes
0
answers
76
views
python encoding result from API request
I am using an API request to retrieve data from an external site. But when the data includes a foreign character, the code fails.
In a git bash shell, I can run
curl -s https://api.scryfall.com/cards/...
1
vote
1
answer
129
views
Python Getting Very Strage Data, how to decode (requests)
I use:
import time,requests
ts = str(int(time.time()))
s = requests.session()
payload = {"email": "[email protected]","timestamp":ts}
...
0
votes
3
answers
95
views
Python requests POST method parses XML always as ANSI
I have a script which sends a XML within a POST method using python requests module to an API.
This code works from my test machine (windows) when I deploy the script to my PROD server (Debian) I ...
0
votes
2
answers
620
views
How to read the contents of pdf files which encoding is `none`?
Upd: solved, see the comments below.
When I try to read the contents of some pdf files I get an empty string. I have noticed that this happens to pdf files which encoding is none, and it works fine ...
0
votes
0
answers
31
views
Python Requests lxml Encoding
Help what to do. When you try to search, it often displays a name with an encoding error in the squeak. That is, for example (УкÑаинÑкий VOD поÑÑаÐ)
Code
from base64 import encode
import ...
1
vote
1
answer
710
views
Python fails to decode EUC-JP strings with the "㎝" character
I've run into an odd issue with encoding. When viewing the pages with chrome, they render as expected and even can be saved without issue, but when saved via requests or urllib, the resultant files ...
0
votes
0
answers
234
views
Encoding problem when reading urls from a csv file in python [duplicate]
I have a csv file with some urls; after reading through it, in python with:
import csv
rows = []
with open("links.csv","r", encoding = "utf-8") as c:
csv_reader = csv....
0
votes
1
answer
199
views
Encoding Requests response - Python
I can't figure out why I'm not getting the letters æøå from my response. ø = \u00d8
The documentation on the api says utf-8 and I've checked that r.encoding is utf-8
header = {'Client-Identifier': '...
0
votes
2
answers
271
views
ConvertApi: corrupted file from the API response
I have a local file default.xlsx.
I send it to https://v2.convertapi.com.
I take the content from the response and I try to save it in a default.pdf.
I have no error message.
When I try to open the ...
0
votes
0
answers
85
views
encoding issue with python requests library
i was trying earlier today to parse a web page fetched by python3 requests library with beautifulsoup, here is the link:
https://azuremlsdktestpypi.azureedge.net/codegen
response = requests.get('https:...
1
vote
1
answer
285
views
How to resize an image in python
I am trying to resize an image:
from tkinter import filedialog
path = filedialog.askopenfilename(initialdir="C:\\Users\\josho\\Pictures", title="Choose a ...
0
votes
0
answers
80
views
How to handle broken emojis characters in Flask requests? [duplicate]
My code returns broken emojis characters in a Flask service:
@app.route('/keyword_extraction', methods=['GET'])
def extract():
text, parameters = _parse_parameters()
if 'error' in parameters:
...
0
votes
1
answer
319
views
Python requests.get content encoding problem
I am working on a scraping project using requests.get. The html file contains a relative path of the form href="../_static/new_page.html" for the css file.
I am using the below code to get ...
0
votes
1
answer
30
views
Sort Items in Python
INPUT:
`videoshop=[]
for i in range(0,3,1):
movie={}
print("Enter Movie Name")
movie["Name"]=raw_input("Enter Here: ")
print("Enter Movie Duration&...