Scraping .php websites -
i'v been having trouble scraping following website content: http://www.qe.com.qa/wp/mw/marketwatch.php
using file_get_contents() never gets me right tag. scrape content of following tag: td aria-describedby="grid_offerprice"
is website protected scraping? because when try same method diffrent websites works. if yes, work around ?
the way see if scraping works output file_get_contents returns. if have nothing or error maybe ip has been restricted admin.
if returns source code it's working maybe tag you're looking has not been found. eliminate failures in process answering these questions first, 1 @ time.
i viewed source code , aria attribute searching doesn't appear exist.
it seems load data on page source @ this page (http://www.qe.com.qa/wp/mw/bg/readdata.php?types=selected&itype=so&dummy=1401401577192&_search=false&nd=1401401577279&rows=100&page=1&sidx=&sord=asc
)
if want data page use file_get_contents on directly.
the data page in online json editor gives neat way of seeing whether useful solution you.
a sample of data listed below:
{ "total": "140", "page": "1", "records": "140", "rows": [ { "topic": "qnbk/nm", "symbol": "qnbk", "companyen": "qnb", "companyar": "qnb", "trend": "-", "stateen": "tradeable", "statear": "المتداوله", "caten": "listed companies", "catar": "الشركات المدرجة", "sectoren": "banks & financial services", "sectorar": "البنوك والخدمات المالية", "shariahen": "n/a", "shariahar": "n/a", "offervolume": "7503", "offerprice": "184.00", "bidprice": "182.00", "bidvolume": "15807", "openprice": "190.0", "high": "191.7", "low": "181.0", "imp": "182.0", "lastprice": "182.0", "prevclosing": "187.0", "change": "-5.0", "percentchange": "-2.6737", "trades": "980", "volume": "2588830", "w52high": "199.0", "w52low": "145.0", "value": "481813446.4" }, { "topic": "qibk/nm", "symbol": "qibk", "companyen": "qatar islamic bank", "companyar": "المصرف ", "trend": "+", "stateen": ...
make sure read link about 'scraping' etiquette.
Comments
Post a Comment