I'm currently trying to make a web automation script in python using webbot. My issue is that I made a list which contains cities/towns. The script later randomly selects a city from this list. I need to assign each city a postcode. How would I do that, I'm completely lost. Here's the script:
from webbot import Browser
import random
import time
foo = ['Presov', 'Nitra', 'Kosice', 'Nove Zamky', 'Martin', 'Kezmarok', 'Stara Lubovna', 'Sabinov', 'Velky Saris', 'Ruzomberok', 'Liptovsky Mikulas']
web = Browser()
web.go_to('url ow website goes here')
web.click('Accept all' , tag='span')
web.type('randomemail@gmail.com' , into='Email')
web.type('passwordPass.123@' , into='Password')
web.type('passwordPass.123@' , into='Confirm password')
web.type('randomusername' , into='account name')
web.click('Continue (step 1 of 5)' , tag='span')
time.sleep(8)
web.click('Personal' , tag='span')
web.type('Adrian Robotnik' , into='Full Name')
web.type('+420521526' , into='Phone Number')
web.click('United States' , tag='span')
web.click('Country', tag='span')
web.type('Myjavska 68' , into='Address')
web.type(random.choice(foo) , into='City')
web.type('Netherlands' , into='State, Province, or Region')
web.type('POSTCODE GOES HERE' , into='Postal Code')