我想從網頁獲取一些數據(html標籤),但我不能。出於某種原因,我只是主要是空標籤。無法從網頁讀取html
這是網址:http://www.miamidade.gov/transit/mobile/routes.asp
這是我的Java代碼:
import java.io.IOException;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
class xyz{
public static void main (String[] args) throws IOException {
Document doc = jsoup.connect("http://www.miamidade.gov/transit/mobile/routes.asp").userAgent(" Mozilla/5.0").timeout(3000).post();
String title = doc.html();
System.out.print(title);
}
}
我沒有工作...的
的源代碼併爲你工作?請讓我知道... – skinnycat
是的,我的工作方式。雖然我沒有測試它與您的網頁 – Rasel
它也適用於我...也謝謝。 – skinnycat