#网址:http://data.shishicai.cn/cqssc/haoma/#Demo:<?php/* Created on [2013-5-1] Author[Newton] Filename[action.php]*/#编码转换function convToUtf8($str) { if (mb_detect_encoding($str, "UTF-8, ISO-8859-1, GBK") != "UTF-8") { return iconv("GBK", "utf-8", $str); } else { return $str; }}header("content-type:text/html;charset:utf-8");error_reporting(E_ERROR);$pages = file_get_contents('http://data.shishicai.cn/cqssc/haoma/');//$pages = htmlspecialchars($pages);$pages = convToUtf8($pages);echo "pages-->>".print_r($pages);echo PHP_EOL;$doc = new DOMDocument();$new_doc = new DOMDocument('1.0', 'utf-8');echo "doc-->>".print_r($doc);echo PHP_EOL;$dom = $doc->getElementsByTagName('table');$newdoc = $new_doc->loadhtml($dom->item(2)->nodeValue);$table = $new_doc->saveHTML();echo "table-->>{$table}".PHP_EOL;#result:#……乱码……#pages-->>1 DOMDocument Object ( ) doc-->>1 table-->>#table是空的……?>
回复讨论(解决方案)
我想获取的内容是:
对应代码片段:
页面数据是JS填充的。你得爬那个JS脚本。
貌似这样做繁琐了吧?
貌似是用了frame框架内嵌在tbody里面,然后用JS代码来做html。
打开http://datacache.shishicai.cn/script/2f67117ba1b58074.js后,
搜索'frame'出来6条结果
凭我的技术分析是不出框架的链接
LZ看来也是位大神,技术分好高,仰望ING
http://data.shishicai.cn/handler/kuaikai/data.ashx
post: lottery=4&date=2013-05-06
采集这儿.
楼上链接抓的是空白……

AphpdependencyInjectionContainerisatoLthatMatagesClassDependencies, EnhancingCodeModularity, Testability, andMaintainability.itactsascentralHubforcreatingandinjectingdependencies, sheReducingTightCouplingandeaseaseaseSunittesting.

Pilih DependencyInjection (DI) Untuk aplikasi besar, servicelocator sesuai untuk projek kecil atau prototaip. 1) DI meningkatkan kesesuaian dan modulariti kod melalui suntikan pembina. 2) ServiceLocator memperoleh perkhidmatan melalui pendaftaran pusat, yang mudah tetapi boleh menyebabkan peningkatan gandingan kod.

Phpapplicationscanbeoptimizedforspeedandeficiencyby: 1) enablingopcacheinphp.ini, 2) menggunakan preparedSwithpdofordatabasequeries, 3) menggantikanloopswitharray_filterandarray_mapfordataprocessing, 4) configuringnginywinginywinyvinyvinginy

PhpeMailvalidationInvolvestHreesteps: 1) formatValidationingRegularExpressionStocheckTheemailFormat; 2) dnsvalidationtoensurethedomainhasavalidmxrecord;

Tomakephpapplicationsfaster, ikutiTheseSteps: 1) UseopcodecachinglikeopcachetostorePrecompiledscriptbytecode.2) minimizedatabasequeriesbyusingquerycachingandeficientindexing.3)

ToimprovePhpapPlicationspeed, ikutiTheSesteps: 1) EnableopCodeCachingWithApcutoreduceScriptExecutionTime.2) pelaksanaanDatabasequerycachingingPdotominimizedataBaseHits.3)

Suntikan ketergantungan (DI) dengan ketara meningkatkan kesesuaian kod PHP oleh kebergantungan transitif secara eksplisit. 1) Kelas Decoupling dan pelaksanaan khusus menjadikan ujian dan penyelenggaraan lebih fleksibel. 2) Di antara tiga jenis, pembina menyuntik kebergantungan ekspresi eksplisit untuk memastikan keadaan konsisten. 3) Gunakan bekas DI untuk menguruskan kebergantungan kompleks untuk meningkatkan kualiti kod dan kecekapan pembangunan.

DatabaseQueryoptimizationInpinvolvesseverSlegatiesToenhancePratePratePratePratePratePregiesToRperformance.1) selectOnlynessaryColumnStoReducedatatatransfer.2) UseIndexingTospeedupdatareTrieval.3) PrevancequerycachingToStoreresultSoffReFfeFfffffffffffffffffffffffffffffffffffffffffffferseprewfffffffffffersepresseprespersepresperseprespersepresperseprespersepresperseprespers


Alat AI Hot

Undresser.AI Undress
Apl berkuasa AI untuk mencipta foto bogel yang realistik

AI Clothes Remover
Alat AI dalam talian untuk mengeluarkan pakaian daripada foto.

Undress AI Tool
Gambar buka pakaian secara percuma

Clothoff.io
Penyingkiran pakaian AI

Video Face Swap
Tukar muka dalam mana-mana video dengan mudah menggunakan alat tukar muka AI percuma kami!

Artikel Panas

Alat panas

EditPlus versi Cina retak
Saiz kecil, penyerlahan sintaks, tidak menyokong fungsi gesaan kod

PhpStorm versi Mac
Alat pembangunan bersepadu PHP profesional terkini (2018.2.1).

SublimeText3 Linux versi baharu
SublimeText3 Linux versi terkini

Versi Mac WebStorm
Alat pembangunan JavaScript yang berguna

ZendStudio 13.5.1 Mac
Persekitaran pembangunan bersepadu PHP yang berkuasa
