title: How to nest loop number into an xpath in python?
body: <p>I have the xpath to follow a user on a website in selenium. Here is what I thought of doing so far:</p>
  
  <pre><code>followloop = [1,2,3,4,5,6,7,8,9,10]
  for x in followloop:
      driver.find_element_by_xpath("/html/body/div[7]/div/div/div[2]/div[&gt;&gt;&gt;here is where i want the increment to increase&lt;&lt;&lt;]/div[2]/div[1]/div/button").click()
  </code></pre>
  
  <p>So where I stated in the code is where I want the number to go up in increments. Also as you see with the for loop Im' doing 1,2,3,4,5...can I code it more simply to be like 1-100? Because I don't just want 1-10 I will want it 1-whatever higher number.</p>
  
  <p>I tried to just put x in where I want it but realised that python won't pick up that it's a variable I want to put in that slot and will just consider it as part of the xpath. So how do I make it put the increasing number variable number in there on each loop?</p>