Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Jean Gerard
How about web clipping/scrapping
June 5, 2012 11:50 AM
Answer

Jean Gerard

Rank: New Member

Posts: 10

Join Date: June 5, 2012

Recent Posts

Hello,

i am searching for some weeks now, but i never found anything about it.

I want to create a web clipping/scrapping portlet by myself and i don't found any help.

Anybody already had develop such as this portlet?

Can you help me, give me some advices etc...

Thank you very much.
Jelmer Kuperus
RE: How about web clipping/scrapping
June 5, 2012 2:35 PM
Answer

Jelmer Kuperus

Rank: Liferay Legend

Posts: 1190

Join Date: March 10, 2010

Recent Posts

What kind of help are you looking for ?

When i screenscrape something i usually just use commons http client and scrape the relevant sections using regular expressions or nekohtml
David H Nebinger
RE: How about web clipping/scrapping
June 5, 2012 4:45 PM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 6275

Join Date: September 1, 2006

Recent Posts

I've had a lot of luck w/ htmlparser.
Jean Gerard
RE: How about web clipping/scrapping
June 12, 2012 1:50 AM
Answer

Jean Gerard

Rank: New Member

Posts: 10

Join Date: June 5, 2012

Recent Posts

What kind of help are you looking for ?


For example, i want to do it in the client(in my jsp), can i use jquery? Do exist an plugins jquery for web clipping?


I obviously missed one thing into htmlparser.

So, i had this :

 1protected String showView(ModelMap model) {
 2
 3        try {
 4
 5            Parser parser = new Parser("myurl");
 6            HasAttributeFilter filterattr = new HasAttributeFilter("id", "logo");
 7                listenode = parser.parse(filterattr);
 8            resultnode = listenode.toHtml();
 9
10        } catch (ParserException e) {
11            // TODO Auto-generated catch block
12            e.printStackTrace();
13
14        }
15
16        model.addAttribute("attrclipping", resultnode);
17
18        return "webclippingserver/webclippingserver";
19    }


But i had no results with this, when i tried a .size() on resultnode i have a 0.

Did i miss something?

thank you
Corné Aussems
RE: How about web clipping/scrapping
June 12, 2012 12:22 PM
Answer