You are here: Re: match regular expressions in a webpage, not the entire source « PHP Programming Language « IT news, forums, messages
Re: match regular expressions in a webpage, not the entire source

Posted by d on 09/27/90 11:37

"charliefortune" <google@charliefortune.com> wrote in message
news:1137506279.617801.311270@f14g2000cwb.googlegroups.com...
> Here is an example of one of the pages of a sold out item
>
> http://www.subsidesports.com/uk/store/product_details.jsp?pid=72057594037941652&cid=402&brc=&red=product_list.jsp?id=402,http://www.subsidesports.com/uk/store/product_details.jsp?pid=72057594037941652&cid=402&brc=&red=product_list.jsp?id=402,
>
> and here is an in-stock one
>
> http://www.subsidesports.com/uk/store/product_details.jsp?pid=72057594037941998&cid=402&brc=&red=product_list.jsp?id=402,
>
> Looking through, it seems that the javaScript array element
> productPrice[0] contains the information I need, so I suppose the
> sensible thing would be to look at this alone to decide if an item is
> in stock. I think it is null if the product is available. So my
> question now becomes ....
>
> how can I test the value of this variable using PHP on the retrieved
> document ? Surely not looking for the regex
>
> thanks
> productPrice[0] = 'SOLD OUT' ?

Why don't you check to see if this text is in the document or not:

<span style="font-size:20px; color:#000000;">SOLD OUT&nbsp;</span>

Surely that'll tell you if it's sold out or not, regardless of javascript.
You don't even have to strip any tags before checking for it... :)

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация