Results 1 to 5 of 5
- 11-27-2012, 03:31 PM #1
Member
- Join Date
- Nov 2012
- Posts
- 9
- Rep Power
- 0
Extracting
I am trying to use regex to extract all the <a href links and print them, but I think it keeps reading the URL instead of the HTML, the code I have currently is:
Any way I can make this work? I think I have the right concept, but implementing it seems tricky.Last edited by Castle; 11-27-2012 at 11:34 PM.
- 11-27-2012, 03:48 PM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Re: Extracting <a href links from html code using regex
Um, you need to actually connect to that URL, via a URLConnection.
At the moment you are, as you suspect, simply matching against the String "http://www.google.co.uk".Please do not ask for code as refusal often offends.
- 11-27-2012, 04:10 PM #3
Member
- Join Date
- Nov 2012
- Posts
- 9
- Rep Power
- 0
Re: Extracting <a href links from html code using regex
My parameter needs to stay as a String and I can't cast from a string to an URL, how do I connect to the URL with the string?
- 11-27-2012, 04:20 PM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
- 11-27-2012, 04:32 PM #5
Re: Extracting <a href links from html code using regex
Why do they call it rush hour when nothing moves? - Robin Williams
Similar Threads
-
how to get links in html file
By atia akram in forum New To JavaReplies: 3Last Post: 11-04-2012, 05:26 PM -
help me..how to get links in html file
By thangbomlennet in forum New To JavaReplies: 13Last Post: 11-03-2012, 05:31 PM -
Please how do i extract youtube video id from these links maybe using Regex
By sledjama in forum New To JavaReplies: 5Last Post: 06-25-2011, 08:45 PM -
using href for JEditorpane reading html file
By crozarius in forum Advanced JavaReplies: 0Last Post: 04-13-2011, 07:08 PM -
How find Links in a HTML Page
By binumathew in forum NetworkingReplies: 6Last Post: 08-03-2010, 06:49 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks