A
A
Andrey Ovchinnikov2018-08-19 15:58:21
Python
Andrey Ovchinnikov, 2018-08-19 15:58:21

How to parse gg11.bet website?

Hi everyone, here's the deal. I'm learning Python quite recently, and I decided to practice a little by making a parser. The bottom line is this: the parser must take odds from the site gg11.bet (only for live bets). But for some reason, when parsing, the main id="betting__container" container does not show the structures nested in it, and therefore it is not possible to parse the coefficients. Can you help?

import requests
from bs4 import BeautifulSoup


BASE_URL = 'https://gg11.bet/ru/betting?matchStatuses=LIVE'


def get_page():
  r = requests.get(BASE_URL, headers={'User-Agent':'Chrome/60.0.3112.113'})
  return r.text

html = get_page()

def get_coefficients(html):
  soup = BeautifulSoup(html, 'html.parser')
  koefs = soup.find('div', class_='__app-Odd-inner odd__inner___3F_cm')
  return koefs



print(get_coefficients(html))

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Ambrosian, 2018-08-19
@Jailpy

Disable JS in the browser.
If you see nothing too, then it means you won’t be able to say it like that.
You need a specialized tool - PhantomJS, SlimerJS or, at worst, Selenium

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question