0
Tcl/Tk中是否有一個函數來顯示鏈接中所有可用的URL?我想開始編寫具有一些功能的web爬行器。Tcl Tk顯示所有可用鏈接
For example:
the user types this:
"www.testsite.com"
and he will get that:
"www.testsite.com/dir1/"
"www.testsite.com/dir2/"
e.g.
或者用像phyton這樣的其他語言編程它會更好嗎?
br
看來當我運行它針對我公司的Intranet頭版工作,雖然我不認爲如果文檔有我會發布的鏈接列表... –
沒有'href'屬性的'a'元素(例如名字錨),可以使用'foreach href [$ doc selectNodes {// a/@ href}] {puts [lindex $ href end]}''。 –
@PeterLewerin我_think_ XPath在這種情況下最好是'// a [@href]';你不需要屬性節點,你只是想指定它們在那裏。 –