- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
for (int i = 0; i < blockNodeSize; i++) {
String blockTitle = subBlock.getElementsByClass("b-results__drugs-title").get(i).text();
String blockData = String.valueOf(subBlock.getElementsByTag("dd").get(i))
//.replace("\n", "")
.replace("<dd>", "")
.replace("</dd>", "")
.replace("<p><i>", "")
.replace("</i></p>", ":")
.replace("<p>", "")
.replace("</p>", "")
.replace("</i>", "")
.replace("<br>", "")
.replace("</br>", "\n");
Qwertiy 13.03.2015 09:41 # 0
Ой))
kegdan 13.03.2015 10:04 # 0
логично. нужно же
1024-- 13.03.2015 21:07 # +1
Qwertiy 07.04.2015 23:32 # 0
Qwertiy 07.04.2015 23:29 # 0
Причём \b - это backspace :D
guest 14.03.2015 01:09 # 0
absolut 14.03.2015 08:05 # +1
guest 26.06.2015 16:44 # 0
guest 16.03.2015 23:20 # +1
alexinzaz 17.03.2015 13:01 # 0
guest 26.06.2015 14:08 # 0
http://stackoverflow.com/questions/590747/using-regular-expressions-to-parse-html-why-not
Regular expressions can only match regular languages but HTML is a context-free language. The only thing you can do with regexps on HTML is heuristics but that will not work on every condition. It should be possible to present a HTML file that will be matched wrongly by any regular expression.
guest 26.06.2015 16:10 # 0
1024-- 26.06.2015 16:20 # 0
> хуями облажил
И ведь правильно сделал.
guest 26.06.2015 16:34 # 0
1024-- 26.06.2015 16:36 # 0
guest 26.06.2015 16:42 # 0
guest 26.06.2015 16:39 # 0
kegdan 28.06.2015 10:11 # 0
расскажи мне про неполноценную машину Тьюринга, неполноценный член общества
3_14dar 28.06.2015 10:44 # 0
3_14dar 28.06.2015 10:42 # 0
-1 This answer draws the right conclusion ("It's a bad idea to parse HTML with Regex") from wrong arguments ("Because HTML isn't a regular language"). The thing that most people nowadays mean when they say "regex" (PCRE) is well capable not only of parsing context-free grammars (that's trivial actually), but also of context-sensitive grammars (see stackoverflow.com/questions/7434272/…)
Регулярки круче конечных автоматов.
dmli 19.03.2015 11:05 # +1
ясно, понятно
guest 26.06.2015 14:27 # 0