from bs4 import BeautifulSoup
from time import sleep
from selenium import webdriver
browser = webdriver.Chrome('D:\\chrome\\chromedriver.exe')
browser.get('https://www.soccerstand.com/ru/')
sleep(6)
print("кликаю")
browser.find_element_by_xpath('//*[@id="live-table"]/div[1]/div[1]/div[4]/div').click()
sleep(3)
data = browser.page_source
soup = BeautifulSoup(data, features='html.parser')
for elem in soup.findAll('div',{"title":"Подробности матча!"}):
for elem2 in elem.findAll('div',{"class":"odds__odd"}):
try:
print(elem2.span.get("alt"))
except:
pass
with open('1.html', 'r',encoding='utf-8') as myfile:
data = myfile.read()
soup = BeautifulSoup(data, features='html.parser')
for elem in soup.findAll('div',{"title":"Подробности матча!"}):
for elem2 in elem.findAll('div',{"class":"odds__odd"}):
try:
print(elem2.span.get("alt"))
except:
pass
@app.route("/", methods=['GET', 'POST'])
def index():
if request.method == "POST":
name = request.json
print(name)
return "Hello"