Note that there are some explanatory texts on larger screens.

plurals
  1. PORetrieving data with Selenium
    text
    copied!<p>I want to get the business hours from ScotiaBank branches that are near to me.</p> <p>The base-URL is: <a href="http://maps.scotiabank.com/" rel="nofollow noreferrer">http://maps.scotiabank.com/</a></p> <p>I then,</p> <p>Click on the "Branches" radiobox.</p> <p>Click on the "Open Saturdays" checkbox.</p> <p>Enter "B3H 1M7" (my postal code) into the search box.</p> <p>Click the Search button.</p> <p>Click on the first result that pops up (Micmac shopping centre).</p> <p>Store the business hours as a variable (called businessHours).</p> <p>And now I'm stuck.</p> <p>How can I export the data that I assigned to the variable to a text file or anywhere else where I can view it later? I'm not sure if this is even possible with Selenium, but if it's not, can you tell me an alternative of how I could do this?</p> <p>Below is the HTML code for the current Selenium script that I have.</p> <pre><code>&lt;tr&gt; &lt;td&gt;open&lt;/td&gt; &lt;td&gt;/en/index.php&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;click&lt;/td&gt; &lt;td&gt;rb_branch&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;click&lt;/td&gt; &lt;td&gt;cb_saturday&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;type&lt;/td&gt; &lt;td&gt;input_address&lt;/td&gt; &lt;td&gt;B3H 1M7&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;clickAndWait&lt;/td&gt; &lt;td&gt;btn_search_address&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;click&lt;/td&gt; &lt;td&gt;result0&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;storeTextPresent&lt;/td&gt; &lt;td&gt;Mon: 9:30 AM - 5:00 PM Thu: 9:30 AM - 8:00 PM &lt;br /&gt;Tue: 9:30 AM - 5:00 PM Fri: 9:30 AM - 5:00 PM &lt;br /&gt;Wed: 9:30 AM - 5:00 PM Sat: 9:00 AM - 1:00 PM&lt;/td&gt; &lt;td&gt;businessHours&lt;/td&gt; &lt;/tr&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload