Linked Questions
22 questions linked to/from How to convert raw javascript object to a dictionary?
1
vote
4
answers
5k
views
Python: load text as python object [duplicate]
I have a such text to load: https://sites.google.com/site/iminside1/paste
I'd prefer to create a python dictionary from it, but any object is OK. I tried pickle, json and eval, but didn't succeeded. ...
5
votes
2
answers
7k
views
Parse JavaScript variable with Python [duplicate]
How can I convert a JavaScript variable (not JSON format) into a python variable?
Example JavaScript variable:
{
title: "TITLE",
name: "NAME",
active: false,
info: {
key1: "...
0
votes
1
answer
1k
views
Parsing javascript data structure in python [duplicate]
I'm trying to find a parser for python that can parse the data structure (to a python dictionary) that is written below (this data structure was taken from var variable in javascript).
{
a: "a",
...
-1
votes
1
answer
435
views
Add double quotes string to return JSON [duplicate]
Currently I'm parsing a string using split and returning the below
{fruit1:"Apple",fruit2:"Orange",fruit3:"Pear"}
I want to convert this string to json using json.loads ...
0
votes
0
answers
301
views
javascript array into python list [duplicate]
I have a string representation of a js array
[{leervorm:"K", id:"48941AA9EE5AB0A1C1258526005CC082", lpzr:"", stap:1, hybride:true, training:[{locatie: "Eindhoven&...
295
votes
17
answers
514k
views
How can I scrape a page with dynamic content (created by JavaScript) in Python?
I'm trying to develop a simple web scraper. I want to extract plain text without HTML markup. My code works on plain (static) HTML, but not when content is generated by JavaScript embedded in the page....
5
votes
3
answers
19k
views
Reading JSON data from JS file
I am uploading one JS file using HTML input file tag. I am reading the data in Python. Since in my data var acb_messages is written, I am not able to parse it. And I want to use this variable name to ...
2
votes
6
answers
5k
views
Python: parsing JSON-like Javascript data structures (w/ consecutive commas)
I would like to parse JSON-like strings. Their lone difference with normal JSON is the presence of contiguous commas in arrays. When there are two such commas, it implicitly means that null should be ...
5
votes
1
answer
7k
views
Scrape page with "load more results" button
I am trying to scrape the following page with requests and BeautifulSoup/Lxml
https://www.reuters.com/search/news?blob=soybean&sortBy=date&dateRange=all
This is the kind of pages that have a ...
1
vote
1
answer
1k
views
Extract Array elements from html
I'm using urlopen and beautifulsoup4 to fetch the contents of a webpage.
The webpage I'm fetching generates some dynamic javascript blocks.
I would like to extract the contents of an entire array.
...
3
votes
1
answer
1k
views
convert a string into python or json dictionary whose keys are not quoted
Imagine the following in python (using 2.7):
myString = '{ key: "value" }'
"value" could be a simple string, a list, a boolean or another dictionary, each of which really is in double quotes
If I ...
0
votes
4
answers
361
views
How to decode JavaScript response in python 3.4+?
I got this response from a website. I really don't know how to decode it and get the information that I want.
Here is the JavaScript response:
{header:{code:0,message:{title:"",detail:""}},body:{...
0
votes
1
answer
201
views
converting 2d json(?) array to pandas dataframe
I have used BeautifulSoup to collect a 2D data array from a website as a string. I believe that the table format is related to the json format, however, when I tried to apply pandas.read_json() on the ...
2
votes
1
answer
116
views
Convert a string into dictionary
I have a .js file with the following content:
AppSettings = {
projectName:'myproject',
url: 'https://www.google.com',
appKey: 'k2y-myproject_124439_18111',...
0
votes
1
answer
146
views
how to get matched substring list in a json-type string with python?
I am trying to find all matched substrings from a input string below:
{
covAnalyzeArgs : [
"--disable-default",
"-co",
"UNINIT_FOR_MISRA:enable_write_context:yes"
],
...