title: Choose element by partial ID using Selenium with python?
body: <p>I am trying to reach an web element in Selenium in Python 2.7. The element ID is like this:</p>
  
  <pre><code>cell.line.order(240686080).item(250444868).unitCost
  </code></pre>
  
  <p>The first number string '240686080' is known, but the second number '250444868' is unknown beforehand.</p>
  
  <p>I tried to reach it by something like this.</p>
  
  <pre><code>from selenium import webdriver
  driver = webdriver.Firefox()
  driver.get("somewebsite.com")
  driver.find_elements_by_id('input.line.order(240417939).item('+ '\d{9}'+').unitCost')
  </code></pre>
  
  <p>So my questions is, is there anyway we can search and reach this element only with part of the ID known?</p>
  
  <p>I found  similar question answered below, but it was in C#. And unfortunately, I don't know C#.</p>
  
  <p><a href="https://stackoverflow.com/questions/11961178/finding-an-element-by-partial-id-with-selenium-in-c-sharp">Finding an element by partial id with Selenium in C#</a></p>
  
  <p>Thank you in advance!</p>
  
  <p><strong>Edited 4/8</strong></p>
  
  <p>The element is coded like this:</p>
  
  <pre><code>&lt;td id="cell.line.order(240417939).item(250159165).unitCost" class="or_monetarydata"&gt;
      &lt;input id="input.line.order(240417939).item(250159165).unitCost" type="hidden" value="135.00" 
      name="order(240417939).item(250159165).unitcost"&gt;&lt;/input&gt;
  
      135.00
  
      &lt;/td&gt;
  </code></pre>
  
  <p>I could get the element list by </p>
  
  <pre><code>value=driver.find_elements_by_xpath("//*[contains(@id, 'input.line.order(240417939)')]")
  </code></pre>
  
  <p>Thank you!</p>