php - Screen Scraping from 2 airline pages -
i travelling same routes every week , few flight connections , carriers suitable. best price check prices manually.
therefore build mini script can enter date , opens several webpages of carrier using "fast" links, not have enter flight dates manually e.g.
know wondering whether possible automise little bit more using screen scraping method. perfect final output should this, provides me overview need:
+------------+---------+---------+ | haj-pmi | date1 | date2 | ... +------------+---------+---------+ | condor | 219,99 | 78,88 | ... | air berlin | 188,99 | 119,99 | ... +------------+---------+---------+
so referring example link above, how can catch price. trying using file_gets_content , curl did not acceptable result seems page not loaded correctly.
curl:
<?php $url = 'https://www.condor.com/tcibe/de/flight/flights'; $postvalues = array( 'om.condor.tcibe.tenant.device' => 'desktop', 'compactform' => 'compactform', 'compactform:adults' => 1, 'compactform:advanced' => false, 'compactform:children' => 0, 'compactform:compartmenttariff' => 'kont_y_lm', 'compactform:infants' => 0, 'compactform:oneway' => true, 'compactform:outbounddate' => '20150614', 'compactform:outbounddestination' => 'pmi', 'compactform:outboundorigin' => 'haj', 'compactform:search' => 'finden', 'javax.faces.viewstate' => 'h4siaaaaaaaaao0abwwcr3x8fceoa6dxkziidk5wq2it+/l57uykahphssycd3kp26y/2r3b8xmtvd3n7jx97kfugmglcggkasefgvr+vfbair8iqtkoqqcgrhcbilfviebcgaoivuk0/oc92y+7293b3di2prkwnft2b+bnm/fevk+z518npybjym2npwupueokmjgsmuthjkon99exx9700c+6sodb0q/qknxqknodzze+vssouasrct24626cfy+trcwkaygzk50kvztkjly6vaiz6rtci7qyffpbrebpdcrtqjlcjzhhb+bfzkqkvrlhsqdpme/5wtx7vrhe/jjasujdajq9bvzvzpjzpaveus4xksux9csivkzmoqxxdv2jgk/cm3duqipazubxuiqkjb9nukezx/04xtwj/bcb0diy2jh2vqtvm380ofmjsiafk13gih5zgqcvyjb87pvf+ucttxu6sccc6vmw1boffosb/y7wqixknnz+/oi6l//2awcvvyb2k17jjb2mytossjvzytogpfhvxvupasy55yeanoz86k3ih868esxb1ugo6vxmzlyzh3qzexfcn/k+wt6plyh0zry//f3psz++vv7ipu6x/h3+itmoi4urjqdvmejfsugnhaslg9aguf+gpr63nfnqy8prw65aftc2ner8ai1k/nn9r0eqjz0n1ghshw702seytdqvmlz+xlxrr/1e+noxmrjbvb6mysmdk93ymh7ag+ivcontw6cwlbwlzcruv3lxzi9deovij+mcj31lekkj+ke52sd4m0t+joucgcbsmsf9joyrbq4qlnvd0znfyhrjvr6wsirduzemzet7zhpblzzmtlnel5fjqvzfvvlqz32yzhdkqoibbzkreqjlxu/9vo/54vxx5xy5dzbk7tcqgxlhbk3wmy8q+mwt0yrncva6yigzqgdujz+mnp6aa/apqvzrxia39nm2n+va+ukhkqrdetfiloabxyzud0sqyzrdcpmpb8pp+hbscwcevjxkejepm6vmj0v1axr2vxrcqr9jwsplwnl1wthejptmspfotekrvvirht6xyfnju2mfkz5ourvqjnwatvg4m1zynyfhqpd1yeheofqmj/34chhscmxhah5y+mrp9djivqljkau7als4kzdzjxy7icbaost98notfhims3h4ugbpjp6bt+udko1xgx4dpybqsjeqfcymlz0wems4lagisdkuieb8iuqmrhqb+yxv9dqwzmb5jk7ogr6p4rydz3oqbwuycvtrkxjtfhcb2z0a6rewnotzb9sd/agjc2bvzdbvwgt9+/mxvvimm/+mhgwhdguubm6ys8k8gniowja2hxbzjavzijtn+9gomdxnnhpblxizwavk4rs5ciaf0cqbcrayaqowaybnfht8cfq38/n7hdw+sdp3syrzeycfelaynqrq8gjls7o8wzcgfjgbl2dcb8f6nxvhqh4sxmz3g7komjgpvbyybfpxmsd82ball9dv20/a8mb4/t+f5za/g3b7nxo8++npfp9x6tpex9vt0bnwoasbzmkfqjj2vheexssl0cu/fhphwbhegpnkrqy0vkbs1niysxuqcocjmecbviqmgzfz4nv10sa3xvnscy84si4dkdsriwskt0sd1jzxnds5f0mvqulhtw04w1b2kp0fewtrsrphdcasaf1byemmv28faw6ilnfvjfzsz/vdawt//npoi4ccd0faw6x8mzyxtnpekmnlsonuphlbnu6k04luakd74wotor9h7cl7z/fvnjt6mokiognrwoqb5aumgvfbxq8xrse/joplvkqo3z2e2lwyglnt1blze9x1bq8l7s+jdlg0yjvke+i4gwri40zphzswgynafrw5iebeywikqe2zh9poearv/aeiws4tjot3omrl6mayfqo7rop1lfy5gbaa14fua7legngridbtaz6r9ccfiy0dj9lzz2pyslxdt+58t3rdkmvfsubkz7yhbl49jm0jgc75uocmj5voo8beai48nouwhvl93dpvxzki0jsgwugbm97cpqx5vgakq70bvz2pbjcb2zsxjbygjhj8rcwgzmsup7sgdq7uhqyk54legpfcafdyqbqv/oi35xu0srytnpgpzgqcykcybsburd056zu9hielviry29sk3gzyhxaeqlz9v0imwcrz0us1znutcqlh/qjum3gj3l4qkclxwdqqqvkxirpanr7tan+eobi1js2ij5ihilasvuj5lur5swivigniaprv5iaisp3ydcoxj4y1uimwqitjkkeggw9ub1iestmlu3571fmfo78es4mns7qvraalirunb/ipi9gltfmkcold+hna0g9zb/mrdpdy6zsbejkunqmouseogpjqcewybakz5nz6bdwoxmelbo6+88lrn7i+7vz9nat7fllj1cusuoclmcllp0rvrpehidrrparcozxfb62zv11zmbdrolimfyac6tbaqz77dv2lkvbkghv8vxfe/cvezkecqo9brfy4rywsjccergt6xale8v07qzopezadtfhdwrcc3j/mdu7k47vb28lckgoez2xy7ewlx9r1hkfpsfk+emvpduz8bofn7zhb4wsyve2yqi2cuawy5mgszcplifhbtjllllautra2q/qaxzdqaewscmc3mb3xi0/hwxyzkuzj4tjyn85ylkfn3wc6sfllkyg3bpe1lp2zlpb/h5bwwussfjy6l43eaoeipexhbutb4yj8evzbrbsda6yaso4lbc431+kcakknmjythdtdx/sebzcbhbrnldh6nnai40fb/okum2yflfnwij8bx7czocbbqhy0rnd72vem2h3vp+aqpu20polxisb8sxguz+g1wypmhfgerzd5qjyfsfwslwevld+1ihcc970ljst8ppiezfd/r2u4noha4owhjr1itonwgzz6y8s+w7v31gumi/477poxmluzkjhadmsp23nzmyjilcc04jutvkzjo7jbt09i8yky1gsnyu9//lc1tcby9moc2hwxjc+aimyluv7mclh9epmrbf4uuqzczxjhdssfp4o3js3yjmdao8ilxtmue3axiud013tjh1h1oftb488dq5puvcr7yngqyrpyjklopa6zebkya5zkuhb9li9wrm0t9z5j5pz2ecccbmlava2knwm1hqxy7wjplijlkyi3hsyle1lx5jzc5bwqwvlup8fwjb1wdhjsdykrfd3b3g7kgqqav7d5wcggb8ijb+lkfswkmpxpoyc/ntm7sceyym0ohhozwkaub7unb7dnah+jpmmo15u1x/qidewokvnbi9op0/gymdsufchey7zmexg1vapagqhcu0yg7iaxdrsku5zqdx/w3lid3r01pgpb2jeklfwkn0fkcw406a1z4ttmuc8ozhm3wfsdpgzeeus29z9ay5sjmjhsfykwhkqbi/lnz94e+hhii5hypiukxamawkrh3soumus8tzbw0ca2qyflxlz/usrnvgzoijraw4vetx9gczh+auk22hhhaclwwhaizd7jhbnm+y9z1ptdpnmho6wi60ib947sa1gj8htleyqiwnwx6nzvwbep+catt11gw8ecswwp0e+jrsgkjv2laoue1qc0zwwldmxbzy4wmn7e1umf4syz2fwnmyqtgvpyuw0qabeti0jyeazijj8ihj/ejhud5e+4ujary0/t/s/kkg6ty7z2uuuaayfyhu9gstr3yqzfjrdjrlinse92xan7svkxdcer4dxuohe/eu9f6/8bwq+mfmmtaaa=',); $ch = curl_init(); curl_setopt($ch, curlopt_ssl_verifypeer, false); curl_setopt($ch, curlopt_failonerror, true); curl_setopt($ch, curlopt_cookiesession, true); curl_setopt($ch, curlopt_followlocation, true); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_cookiefile, 'cookie.txt'); curl_setopt($ch, curlopt_cookiejar, 'cookie.txt'); curl_setopt($ch, curlopt_useragent, 'mozilla/5.0 (macintosh; u; intel mac os x 10.5; en-us; rv:1.9.2.3) gecko/20100401 firefox/3.6.3'); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_post, true); curl_setopt($ch, curlopt_postfields, $postvalues); curl_setopt($ch, curlopt_connecttimeout, 30); curl_setopt($ch, curlopt_timeout, 30); $data = curl_exec($ch); curl_close($ch); echo $data;
any tips?
Comments
Post a Comment