score:0
Accepted answer
one option is to use the api that provides the data for the highcharts.
note: there are different sources data-without-keyshops-url
and data-with-keyshops-url
step#1 - generate the dataurl from the product page
soup = bs(requests.get('https://gg.deals/game/snowrunner/').text, 'lxml')
dataurl = 'https://gg.deals'+soup.select_one('#historical-chart-container')['data-without-keyshops-url']
step#2 - request the json data
r = requests.get(dataurl, headers={'x-requested-with': 'xmlhttprequest'})
r.json()
example
import requests,json
from bs4 import beautifulsoup as bs
url = 'https://gg.deals/game/snowrunner/'
r = requests.get(url)
soup = bs(r.text, 'lxml')
dataurl = 'https://gg.deals'+soup.select_one('#historical-chart-container')['data-without-keyshops-url']
r = requests.get(dataurl, headers={'x-requested-with': 'xmlhttprequest'})
r.json()['chartdata']['deals']
output
[{'x': 1581956320000,
'y': 39.99,
'shop': 'epic games store',
'name': '17 feb 2020 16:18 - 22 may 2020 15:38'},
{'x': 1590161908000,
'y': 29.99,
'shop': 'epic games store',
'name': '22 may 2020 15:38 - 11 jun 2020 17:11'},
{'x': 1591895501000,
'y': 39.99,
'shop': 'epic games store',
'name': '11 jun 2020 17:11 - 16 jun 2020 13:18'},
{'x': 1592313517000,
'y': 31.99,
'shop': 'epic games store',
'name': '16 jun 2020 13:18 - 30 jun 2020 13:20'},
{'x': 1593523255000,
'y': 39.99,
'shop': 'epic games store',
'name': '30 jun 2020 13:20 - 23 jul 2020 16:08'},
{'x': 1595520520000,
'y': 31.99,
'shop': 'epic games store',
'name': '23 jul 2020 16:08 - 6 aug 2020 15:03'},
{'x': 1596726196000,
'y': 39.99,
'shop': 'epic games store',
'name': '6 aug 2020 15:03 - 24 sep 2020 16:19'},...]
Source: stackoverflow.com
Related Query
- Scrape data from graph generated with Highcharts
- Data from MongoDB results with empty Highcharts graph
- How do I scrape data from a highcharts graph in python?
- Highcharts - Dyanmic graph with no initial data
- Add dynamic data to line chart from mysql database with highcharts
- Creating a line graph with highcharts and data in an external csv
- Highcharts - Global configuration with common code and unique data & Headings
- How to populate a Highcharts axis with string formatted data from a PHP array
- Highcharts not displaying series data for graph with multiple Y-axes
- How can I make a graph with highcharts from csv file?
- HighCharts & MVC: How to load whole graph definition and data with JSON?
- Highcharts loading data from a HTML table with a title
- HIghcharts column graph with more than 50 data points
- highcharts example for using data from database with mvc
- Generating Highcharts from MySQL data with PHP does not work
- Plot Highcharts data from past 30 days with Ruby on Rails
- Draw real time data graph with Highcharts
- HighCharts populate Pie Chart with data from SQL Database
- loading highcharts with data from database
- How to use highcharts in reactjs with fetched data from API
- Extract data series from a JSON array for a Highcharts chart with 2 y-axis
- HighCharts column chart populated with series data from a function
- I am using click event to trigger a new page to generate the drill down data from highcharts however the entire chart is being generated
- Highcharts with data populated by php generated html table - only one will load
- Highcharts series visibility with csv data source
- HighCharts activity gauge populated with series data from a function
- Highcharts column chart with data from mongodb
- Can I Create a Single HighCharts Graph from Multiple Data Sources (Multiple GoogleSheets in this case)
- Set HighCharts data from JSON string with setData() function
- Fomatting labels on Y-axis in Highcharts with Data from HTML table
More Query from same tag
- Function to change the Highcharts fontSize
- Access props and state of current component in React JS within an event handler
- Highcharts : draw a chart with data from XMLHttpRequest ()
- Highcharts thinks all dates are 1970-01-01, despite them being valid epoch times
- Time not showing correctly in HighChart
- Highcharts data [x,y] written by golang
- Manipulating array to add through setData on highcharts
- HighCharts Column Chart Spacing Between Columns
- Highchart java script getting filled
- Remove spacing on a HighChart graph?
- HighCharts - barchart not rendering correctly in IE8
- Convert Date to Milliseconds
- highcharts col width and border-top
- Efficiently detect missing dates in array and inject a null (highcharts and jquery)
- Highcharts pie rendering in conflict with legend
- How to grab correct highchart number in selectors using Selenium Webdriver with Python with several charts on the page?
- how do I edit/customize tooltip
- javascript variable not works in Highchart
- Poorly Ordered Data Over Websockets
- threshold between 3 color in line charts of highcharts
- Issue with increasing the size of the highlighted area
- high-charts datalabel position needs to change when value is too small
- highchart-export-server --batch command running but not converting json into png
- How to create a HighCharts chart in react
- HighCharts:set the value of yAxis
- How to Change space between series data colums in highcharts?
- Highcharts stacked column chart is missing some values?
- angular2-highcharts Highcharts exporting module
- Highstock - How to handle large data sets
- Highcharts data labels not showing on multiple xAxis and yAxis