Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Correct for different parsing in live.

  • Loading branch information...
commit 769fc2c03db9f4d5155ce2f359427c86af407aa2 1 parent 6757d81
Tony McCrae authored
View
6 src/main/java/nz/gen/wellington/screenscrapers/wellington/WECCScraper.java
@@ -33,9 +33,9 @@ public String getPageURL() {
Newsitem newsitem = new NewsitemImpl();
Tag newsitemDiv = (Tag) newsitemDivs.elementAt(i);
- Tag headingLink = (Tag) newsitemDiv.getFirstChild().getFirstChild();
- newsitem.setTitle(headingLink.toPlainTextString());
- newsitem.setUrl(headingLink.getAttribute("href"));
+ Tag heading = (Tag) this.extractTagsByName(newsitemDiv.toHtml(), "h3").elementAt(0);
+ newsitem.setTitle(heading.toPlainTextString());
+ newsitem.setUrl(((Tag) heading.getFirstChild()).getAttribute("href"));
String dateString = extractTagByClassName(newsitemDiv.toHtml(), "published").toPlainTextString();
dateString = dateString.replaceFirst(".*?(\\d)", "$1");
Please sign in to comment.
Something went wrong with that request. Please try again.