|
|
|
Авторизация и парсинг...
|
|||
|---|---|---|---|
|
#18+
public class ParsingClass { public static void Autorization(String args[]) { if (args.length != 3) { System.out.println("Give three arguments: server, login, password"); } else { try { Session session = Session.getInstance(System.getProperties()); Store store = session.getStore("http"); store.connect(args[0], args[1], args[2]); Pattern LinkReleasePattern = Pattern.compile(".*<TD class=content><SPAN class=prod>(.*)</SPAN></TD><TD class=content>(.*)<SPAN class=prod></SPAN></TD>.*"); Pattern NameReleasePattern = Pattern.compile(".*(http://mysite.ru/download/.*rar|zip|arj|exe|doc|txt|html).*"); Matcher LinkReleaseMatcher = LinkReleasePattern.matcher(received); boolean LinkPresent = LinkReleaseMatcher.find(); Matcher NameReleaseMatcher = NameReleasePattern.matcher(from); boolean NameReleasePresent = NameReleaseMatcher.find(); store.close(); } catch (Exception e) { e.printStackTrace(); } Нашел пример, чуть его переделал....как обращаться с Matcher??? Нужно ли делать обход по Pattern??? Если несложно - поделитесь примерами... ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 16.05.2007, 16:52:07 |
|
||
|
|

start [/forum/topic.php?fid=59&fpage=638&tid=2145728]: |
0ms |
get settings: |
18ms |
get forum list: |
26ms |
check forum access: |
7ms |
check topic access: |
7ms |
track hit: |
46ms |
get topic data: |
20ms |
get forum data: |
5ms |
get page messages: |
73ms |
get tp. blocked users: |
3ms |
| others: | 314ms |
| total: | 519ms |

| 0 / 0 |
