I'm using Python \ Selenium \ Chrome driver to perform webscraping. I want to pass an INT variable (id) to a URL - how do I do this? I have tried all the below but Python errors on this line:
id = 2000
# Part 1: Customer:
#urlg = 'https://mythirteen.co.uk/customerRest/show/?id=2000' working but need to pass variable
#urlg = 'https://mywebsite.com/customerRest/show/?id=' %(id)
#urlg = 'https://mywebsite.com/customerRest/show/?id={id}'
# urlg = 'https://mywebsite.com/customerRest/show/?id='.format(id)
# urlg = 'https://mywebsite.com/customerRest/show/?id='+id
# urlg = "https://mywebsite.com/customerRest/show/?id=".format(id)
# urlg = 'https://mywebsite.com/customerRest/show/?id=' % id
driver.get(urlg)
I receive errors such as:
TypeError: not all arguments converted during string formatting
I know it its not a string though - id is INT.
Ultimately, I will need to loop through and increase the id + 1 each time, but for now I just want to be able pass the actual variable.