-1
我正在一個項目,我必須屏幕刮網站並獲得一個字符串。這是文本的一部分。正則表達式匹配模式之前得到字符串
A HREF = 「/儀表板/指數/ 2971」 標題= 「PROJECT1:PROJECT1」> PROJECT1
我需要得到 「/儀表板/指數/ 2971」 整體的一部分使用正則表達式的文本。目前我有這個:
while(true){
if (buff.readLine()!=null){
String wholeText = buff.readLine();
System.out.println(wholeText.contains("title=Project1"));
htmlCode += buff.readLine() + "\n";
}else{
break;
}
這只是標識「title = Project1」字符串。我需要獲取「/ dashboard/index/2971」部分並將其放入一個字符串中。