Trying to parse the bookmaker's page, the problem is that with the usual query:

import requests r = requests.get('https://1xstavka.ru/live/Football/125983-Friendlies-National-Teams/155464238-Bulgaria-Bosnia-and-Herzegovina/') print(r.text) 

The values ​​I need come in this form:

 <div class="db-stats-table__group"> <div class="db-stats-table__count">{{ _doptablo_stat.corners.val1 }}</div> <div class="db-stats-table__description">Угловые</div> <div class="db-stats-table__count">{{ _doptablo_stat.corners.val2 }}</div> </div> 

I do not really understand this, so I tried to do it with phantomjs: Links are different, because matches go online and change all the time.

 from selenium import webdriver driver = webdriver.PhantomJS() my_url = 'https://1xstavka.ru/live/Football/28811-UEFA-European-U21-Championship/155474879-Gibraltar-U21-Serbia-U21/' driver.get(my_url) print(driver.page_source) 

So the data comes in handy, but it takes as much as 7 seconds for one game, and there are about 50 of them at a time, and everything needs to be analyzed.

Actually the question is, is it possible to somehow imitate these requests, which come when using requests from double curly braces, directly, without loading the entire page? Or some other way to make it faster. Thank you in advance. I leave a link to the site, suddenly someone will be easier to track.

Site

  • that is, you have a question: how to speed up the extraction of dynamic information from sites. Have you tried the official / unofficial API to search? Immediately on 20 games to handle in parallel? Related question: How to parse an html page with javascript in python 3? - jfs
  • api is missing. About parallelism, I did not think so? - karambaq
  • of course. Start with measurements to find out where your bottleneck is. - jfs
  • @karambaq, 1xst avka.ru/{type}Feed/Get1x2_VZip?sports={sportid}&count={count}&mode=4&getEmpty=true and what is this?) I did not find the documentation. type - Line or Live. sportid - up to 9 like. selection method you can find out - Mr Morgan

0