title: Python Selenium Getting link_text from an anchor that is inline
body: <p>in selenium how do I correctly write an xpath or css_selector that would
  parse html such as</p>
  <pre><code>&lt;div class=&quot;fxg-rte      &quot; style=&quot;color:;&quot; data-emptytext=&quot;Rich Text&quot;&gt;
  &lt;p&gt;United States | &lt;a href=&quot;https://www.fedex.com/en-us/home.html&quot;&gt;English&lt;/a&gt;
   | &lt;a href=&quot;https://www.fedex.com/es-us/home.html&quot;&gt;Español&lt;/a&gt;&lt;/p&gt;
  &lt;p&gt;China | &lt;a href=&quot;https://www.fedex.com/en-cn/home.html&quot;&gt;English&lt;/a&gt;
   | &lt;a href=&quot;https://www.fedex.com/zh-cn/home.html&quot;&gt;简体中文&lt;/a&gt;&lt;/p&gt;
  &lt;p&gt;Mexico | &lt;a href=&quot;https://www.fedex.com/en-mx/home.html&quot;&gt;English&lt;/a&gt;
   | &lt;a href=&quot;https://www.fedex.com/es-mx/home.html&quot;&gt;Español&lt;/a&gt;&lt;/p&gt;
  &lt;p&gt;India | &lt;a href=&quot;https://www.fedex.com/en-in/home.html&quot;&gt;English&lt;/a&gt;&lt;/p&gt;
  &lt;p&gt;Canada | &lt;a href=&quot;https://www.fedex.com/en-ca/home.html&quot;&gt;English&lt;/a&gt;
   | &lt;a href=&quot;https://www.fedex.com/fr-ca/home.html&quot;&gt;Français&lt;/a&gt;&lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  <p>to do the following:</p>
  <p>Find any <code>&lt;p&gt;</code> element that contains the text &quot;United States&quot;
  then within the element find any <code>link_text</code> that has &quot;<strong>English</strong>&quot;
  then click that link.</p>
  <p>So specifically I want to look at <code>link_text</code> only within <p> tags that meet a
  given criteria.</p>