views:

41

answers:

1

I'm trying to monitor a small section of a web page for changes using the the Google Page Monitor extension -- https://chrome.google.com/extensions/detail/pemhgklkefakciniebenbfclihhmmfcd

Under advanced settings I can use either Regex or Selectors to accomplish this, but need help with this. In the following html, I'd like to monitor the following for changes in either the URL in line 4 or the text in line 5. Any pointers gratefully accepted.

<div id="rtBtmBox"><div id="sectHead" style="margin-bottom:5px;">
<h3>SLJ's Pick of the Day</h3></div> 
<p align="center">From the&nbsp;March issue</p> 
<p align="center"><a target="_blank" href="http://www.schoollibraryjournal.com/article/CA6723937.html"&gt;
<font color="#0000ff"><strong><em>The Summer I Turned Pretty</em></strong><br/>
+1  A: 

Awesome, to find a question about my own extension on the front page of StackOverflow.

Anyway, it's easier using a selector. This should do the job: #rtBtmBox p:nth-child(3). However, if that paragraph has more contents, you might need something different (post or link the whole page if so).

A regex that will probably work is: <div id="rtBtmBox">[^]*?<a target="_blank" href="([^"]+)"

Max Shawabkeh
Thanks so much, Max. Will need to wait until after the weekend to be sure, but think the selector should do the trick nicely. (The rtBtmBox id is used twice on the page unfortunately, so it would pick up changes in more than one section.)
bibliwho
Bad things happen when an id is used more than once. Try running a test from the Page Monitor page - it should ensure that the right things are being tracked.
Max Shawabkeh