title: WebdriverIO invalid selector: Unable to locate an element with the xpath expression
body: <p>I am facing an issue selecting an element by going up the HTML dome with WebdriverIO. Note: It is easy to select the title by text and the h1 tag or by class name, but i don't want to do that.</p>
  <p>Instead, i'd like the iframe tag to be my starting point and select it by partial src link text &quot;nba-scores&quot;, then go back to the previous div with class=&quot;inner&quot; OR to the div with class=&quot;main&quot; <strong>without</strong> selecting it by class name and once i am on the previous div go to the h1 tag and get the text with pageTitle.getText().</p>
  <p>When i use:</p>
  <pre><code>get pageTitle(){return $(&quot;//iframe[contains(@src, 'nba-scores')]/parent::div//h1)&quot;)}
  </code></pre>
  <p>I am getting a SyntaxError:
  SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//iframe[contains(@src, 'nba-scores')]/parent::div//h1)' is not a valid XPath expression.</p>
  <p>Here is my HTML dome</p>
  <pre><code>&lt;main&gt;
    &lt;div class=&quot;main&quot;&gt;
      &lt;div class=&quot;inner&quot;&gt;
         &lt;h1 class=&quot;h1class&quot;&gt;NBA Scores&lt;/h1&gt;
      &lt;/div&gt;
      &lt;iframe src=&quot;https://xyz/#/nba-scores/view&quot; class=&quot;viewscores&quot;&gt;
      &lt;/iframe&gt;
    &lt;/div&gt;
  &lt;/main&gt;
  </code></pre>
  <p>Any help would be appreciated!</p>