title: python3/selenium/automation - find ID that contains a given string
body: <p>so basically I'm doing web scraping/website automation, </p>
  
  <p>Here's a simple example of what I'm trying to do:</p>
  
  <p>I'm working on a dynamic page that contains a form, and I want to insert data in this form. </p>
  
  <p>Naturally, this dynamic page changes depending on what I inserted before happening on this page. Here's an example of the input field ID of 5 different pages which I'm trying to insert data in. It is therefore generated automatically, and unique:</p>
  
  <ol>
  <li>Listing.Item[Chess <strong>Size</strong>]</li>
  <li>Listing.Item[Shoe <strong>Size</strong>]</li>
  <li>Listing.Item[<strong>Size</strong> Trouser]</li>
  <li>Listing.Item[<strong>Size</strong>]</li>
  <li>Listing.Item[Shoe <strong>Size</strong>]</li>
  </ol>
  
  <p>The same pattern is the string 'Size' here. </p>
  
  <p>I need to insert data in this field, otherwise, I can't move forward on the form. So here's what I tried:</p>
  
  <pre><code>driver.find_element_by_id('Listing.Item[' + any(str) + 'Size' + any(str) + ']')
  </code></pre>
  
  <p>But it doesn't work. Maybe I'm wrongly using the function 'any()'.</p>
  
  <blockquote>
    <p><strong>How can automatically find this unique input in every page I come across, which always contains the string 'Size' in its ID ?</strong></p>
  </blockquote>
  
  <p>XPath &amp; CSS Selector also contains the other word (for this example: Chess, Shoe, and Trouser) in consequence I can't use them</p>
  
  <p>THANKS for help</p>
  
  <p>EDIT:</p>
  
  <p>Here's the whole corresponding HTML:</p>
  
  <pre><code> &lt;input type="text" id="Listing.Item[Shoe Size]"
   name="_st_Shoe Size" size="21" maxlength="50"
   aria-required="true" value=""&gt;
  </code></pre>
  
  <p>=> the value of name and id change each time</p>