我想为Selenium编写一个更改网站参数的循环。我在编写循环调用该网站时遇到问题

时间:2019-03-17 17:14:01

标签: python selenium

for zipcode in zipcodes:
    for page  in pages:
        site = 'https://www.website.com/home?search=+zipcode&cursor=+page'

我希望它在哪里

site = 'https://www.website.com/home?search='+zipcode'&cursor='+page 

但是它实际上不能在硒中起作用

1 个答案:

答案 0 :(得分:2)

尝试

for zipcode in zipcodes:
    for page  in pages:
        site = 'https://www.website.com/home?search={}&cursor={}'.format(zipcode,page)