I doing a webscraping script in Python 3.9.
I'd like to gather some informations from this website: https://www.matchendirect.fr/.
This website is in French but I don't think it's a real problem to try to help me.
The information I need is the array displayed on mouse over in the 'Pronostics des internautes' section. The HTML code start with : <table class="table table-bordered MEDtpro">
I have recreate cookies I've on my browser to simulate my connection following answers on this article How to send cookies with urllib but it didn't work.
Here is my code:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import requests
cookies = {
'PHPSESSID': 'a2q4evve875s1ibamiqmc93ru6',
'c_compte_cle': '76598fbd4fe763e768dc79275c02e11f',
'c_compte_id':'311084',
'c_compte_pseudo':'foobar',
'c_compte_url_image':'%2Fimage%2Fcommun%2Fmembre-med-t16.png',
'c_coucours_promo':'3'
}
headers = {'User-Agent': 'Mozilla/5.0'}
link = "https://www.matchendirect.fr/live-score/caen-toulouse.html"
response = requests.get(link, cookies=cookies, headers=headers)
webpage = response.text
print("Success!") if webpage.find('<table class="table table-bordered MEDtpro">')>-1 else print("Failed!")
Can someone help my with this issue?
This account is a junk account for the one who would like to test on their side.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…