Quick Scraper Node Question (1 Viewer)

Schenk2302

Portal Pro
September 12, 2008
50
14
Bonn
Home Country
Germany Germany
Hello,

how and is it possible to tell the scraper if first retrieve/parse page gives no resut than use the second one. Same vice versa means if first gives a result don't use the second one?

I hope you understand...

Thanks

Schenk
 

fforde

Community Plugin Dev
June 7, 2007
2,667
1,702
43
Texas
Home Country
United States of America United States of America
Sorry, don't understand, can you elaborate maybe using the site you're scripting as an example?
 

Schenk2302

Portal Pro
September 12, 2008
50
14
Bonn
Home Country
Germany Germany
Okay i´ll try:

Code:
    <retrieve name="links_page_com" url="http://www.cinefacts.de/kino/film/${movie.site_id}/${movie.title}/externe_links.html"/>
     <parse name="imdb_com" input="${links_page_com}" regex="${rx_imdb_com}"/>
      <if test="${imdb_com[0][0]!=">
       <set name="movie.imdb_id" value="${imdb_com[0][0]}"/>
      </if>

Code:
    <retrieve name="links_page_de" url="http://www.cinefacts.de/kino/film/${movie.site_id}/${movie.title}/externe_links.html"/>
     <parse name="imdb_de" input="${links_page_de}" regex="${rx_imdb_de}"/>
      <if test="${imdb_de[0][0]!=">
       <set name="movie.imdb_id" value="${imdb_de[0][0]}"/>

If the result is found in the first try then set name, if no result is found, try second one and if found set name .

Hope this makes sens to you now :)

Thanks

Schenk

Sorry i forgot an e
 

fforde

Community Plugin Dev
June 7, 2007
2,667
1,702
43
Texas
Home Country
United States of America United States of America
Just wrap the bottom section in an <if> node like this:

Code:
<if test="${imdb_com[0][0]=">
</if>
 

Users who are viewing this thread

Top Bottom