I have good progress with collect all data but currently i struggle hard with the shop.
def buyFromShop(self):
headers = self.__getHeaders()
server = self.__getServer()
adresse = f'{server}stadt/shop.php?s=2'
parameter = urlencode({'s': 2,
'page': 1,
'change_page_only': 0,
'produkt[0]': 2,
'preis[0]': 0.08,
'anzahl[0]': 1,
'produkt[1]': 3,
'preis[1]': 0.44,
'anzahl[1]': 0,
'produkt[2]': 5,
'preis[2]': 0.5,
'anzahl[2]': 0,
'produkt[3]': 6,
'preis[3]': 0.06,
'anzahl[3]': 0,
'produkt[4]': 9,
'preis[4]': 1.76,
'anzahl[4]': 0,
'produkt[5]': 12,
'preis[5]': 0.14,
'anzahl[5]': 0,
'produkt[6]': 14,
'preis[6]': 0.22,
'anzahl[6]': 0,
'produkt[7]': 36,
'preis[7]': 2.1,
'anzahl[7]': 0})
print(headers)
print(adresse)
print(parameter)
try:
response, content = self.__webclient.request(adresse, 'POST', parameter, headers=headers)
self.__checkIfHTTPStateIsOK(response)
print(response)
print(content)
except:
return ''
For later i guess ill create a list with items per shop available to iterate over the shops