-1
當我使用的URL與jsoup 波斯文字我得到這個例外,我從瀏覽器的地址欄 代碼複製網址:jsoup轉換我的網址到別的......而得到404錯誤
String url = "http://www.tahlildadeh.com/%D8%A2%D9%85%D9%88%D8%B2%D8%B4/%D8%A2%D9%85%D9%88%D8%B2%D8%B4-%DA%AF%D8%A7%D9%85-%D8%A8%D9%87-%DA%AF%D8%A7%D9%85-%D8%A7%D9%86%D8%AF%D8%B1%D9%88%DB%8C%D8%AF";
Document document = Jsoup.connect(url).data("query", "Java")
.userAgent("...")
.timeout(10000)
.post();
System.out.println(document.title());
例外:
Exception in thread "main" org.jsoup.HttpStatusException: HTTP error fetching URL. Status=404, URL=http://www.tahlildadeh.com/%25d8%25a2%25d9%2585%25d9%2588%25d8%25b2%25d8%25b4/%25d8%25a2%25d9%2585%25d9%2588%25d8%25b2%25d8%25b4-%25da%25af%25d8%25a7%25d9%2585-%25d8%25a8%25d9%2587-%25da%25af%25d8%25a7%25d9%2585-%25d8%25a7%25d9%2586%25d8%25af%25d8%25b1%25d9%2588%25db%258c%25d8%25af
問題是,在異常情況下的實際url和url是不同的,我得到404錯誤,當我打開瀏覽器的鏈接。