mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-19 08:49:58 +00:00
parse links more cautiously
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@115 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
e28029c8df
commit
53d0d688fe
4 changed files with 30 additions and 19 deletions
|
@ -225,11 +225,12 @@ public final class BahnProvider implements NetworkProvider
|
|||
+ "von: <span class=\"bold\">(.*?)</span>.*?" // from
|
||||
+ "nach: <span class=\"bold\">(.*?)</span>.*?" // to
|
||||
+ "Datum: <span class=\"bold\">.., (.*?)</span>.*?" // currentDate
|
||||
+ "(?:<a href=\"(http://mobile.bahn.de/bin/mobil/query.exe/dox.*?)\">.*?Früher.*?)?" // linkEarlier
|
||||
+ "(?:<a class=\"noBG\" href=\"(http://mobile.bahn.de/bin/mobil/query.exe/dox.*?)\">.*?Später.*?)?" // linkLater
|
||||
+ "(?:<a href=\"(http://mobile.bahn.de/bin/mobil/query.exe/dox[^\"]*?)\">.*?Früher.*?)?" // linkEarlier
|
||||
+ "(?:<a class=\"noBG\" href=\"(http://mobile.bahn.de/bin/mobil/query.exe/dox[^\"]*?)\">.*?Später.*?)?" // linkLater
|
||||
, Pattern.DOTALL);
|
||||
private static final Pattern P_CONNECTIONS_COARSE = Pattern.compile("<tr><td class=\"overview timelink\">(.+?)</td></tr>", Pattern.DOTALL);
|
||||
private static final Pattern P_CONNECTIONS_FINE = Pattern.compile(".*?<a href=\"(http://mobile.bahn.de/bin/mobil/query.exe/dox.*?)\">" // url
|
||||
private static final Pattern P_CONNECTIONS_FINE = Pattern.compile(".*?" //
|
||||
+ "<a href=\"(http://mobile.bahn.de/bin/mobil/query.exe/dox[^\"]*?)\">" // link
|
||||
+ "(\\d+:\\d+)<br />(\\d+:\\d+)</a></td>.+?" // departureTime, arrivalTime
|
||||
+ "<td class=\"overview iphonepfeil\">(.*?)<br />.*?" // line
|
||||
, Pattern.DOTALL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue