最近工作上用到php爬蟲框架goutte(號稱是php上最好用的爬蟲框架)。這裡記下自己用到過的使用技巧,免得下次使用的時候再摸索。
html: 更多
國家**ip位址
埠伺服器位址
是否匿名
型別存活時間
驗證時間
175.155.24.112
808四川德陽
高匿http
3小時1分鐘前
php:
1.解析出td的內容
$crawler->filter('table#ip_list > tr')->each(function (crawler $node, $i)
return $text;
});return $ip;
});}
2.按位置匹配td標籤
$td = $crawler->filter(『td』)->eq(1)->text();
html : php : $crawler->filter(『div.class1.class1』);
html : php : $crawler->filter(『div#hello』);
html :
部分原創,部分參考了這篇部落格這個我常用來檢測匹配規則是否正確
html : helloworld
php : $crawler->filter(『catchmeifyoucan』)->html();
python基本用法 Python基本用法總結
python 的設計具有很強的可讀性,易於使用。這裡對python基本用法做乙個總結介紹。一 變數型別 1 變數賦值 python中的變數賦值不需要型別宣告,每個變數在使用前都必須賦值,變數賦值之後才會被建立。使用等號進行變數的賦值。2 多個變數賦值 為多個變數賦值時或進行列表內資料的交換時,可以使...
mysql 的基本用法 mysql基本用法
mysql 5.1 中文參考手冊 show databases 顯示資料庫 drop database 資料庫名 刪除資料庫 set names utf8 設定資料庫編碼為utf 8 source x 資料庫名.sql 匯入乙個資料庫 use 資料庫名 嘗試訪問資料庫 create database...
mysql 的基本用法 mysql基本用法
mysql 5.1 中文參考手冊 show databases 顯示資料庫 drop database 資料庫名 刪除資料庫 set names utf8 設定資料庫編碼為utf 8 source x 資料庫名.sql 匯入乙個資料庫 use 資料庫名 嘗試訪問資料庫 create database...