Skip to content

Instantly share code, notes, and snippets.

@francois-baptiste
Created June 28, 2018 12:45
Show Gist options
  • Save francois-baptiste/8078419b677f1c1f00daf6d7d2e989f8 to your computer and use it in GitHub Desktop.
Save francois-baptiste/8078419b677f1c1f00daf6d7d2e989f8 to your computer and use it in GitHub Desktop.
allopneu.com
import requests
cookies = {}
headers = {}
mylist=[
(195,55),
(205,55),
(215,55),
(225,50),
(235,50),
(245,50)
]
for width,height in mylist:
data = {
'tire_search[type]': '',
'tire_search[brand]': '',
'tire_search[diameter]': '17',
'tire_search[load]': '',
'tire_search[speed]': 'Y',
'tire_search[season]': '2',
'tire_search[_token]': '',
}
data['tire_search[width]'] = str(width)
data['tire_search[height]'] = str(height)
data=list(data.items())
response = requests.post('https://www.allopneus.com/desktop/tire/search/1', headers=headers, cookies=cookies, data=data)
for line in response.text.split('\n'):
if 'pneus <strong>' in line:
print((width,height))
print(int(line.split(' pneus ')[0]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment