How to find links in a website

Hello,
Well i have studied the example in page http://java.sun.com/docs/books/tutorial/networking/urls/readingURL.html and coded it.
The program reads the url and outputs the html code of the site , as i understood.
Well, how am i supposed to find the links in a website? Which parts of the html code shall i read ?
May you please tell which class or methods shall i study in order to do it?
Thanks in advance! :)

I was initially tempted to say use an XML parser, but many html pages don't use XHTML (XML compliant HTML). You may just want to try reading the code line by line looking for links yourself. Take a look at the Pattern and Matcher classes to see how regular expressions work.
Here's some sample code to help you get started. What you're looking for is the text in the quotes after an href tag. Notice that with all the possibilities of whitespace, the " *" had to be included. Also, either single or double quotes may be used. The while loop is needed because there could be multiple matches.
String data = "< a href='abc'>one</a> <a href   =  'def'>two</a>";
String regex = "< *a.*href *= *['|\"]";
Pattern p = Pattern.compile(regex);
Matcher m = p.matcher(data);
while (m.find()){
     System.out.println(m.end());
{code}
  That should be good enough, though there's almost certainly cases I've overlooked.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Beginner advise needed on how to find link for app on ipad.

    I am an absolute beginner with a recently purchased ipad 2. I have just purchased garageband from the app store but how do I open it? There is no link on my ipad anywhere but when i check settings it says that garageband is installed. Can someone please advise me on how to find link or am i missing somethng really obvious here, cheers.

    Look for the Garage Band icon on one of your home screens. Tap on it in order to launch it. Swipe from one screen to the next (swipe to the left with your finger) if you do not see it on the first screen.
    If you still can't find it - swipe to the right from your very first home screen and a search feature appears on the screen. Type Garage Band in the text field and search for the app.

  • How to find "start-dreamweaver-first-website" zip in local site folder?

    Hallo...
    I have download that file already. But somehow it does not show up on the "local site folder" when i want to save it as in the tutorial video suggest....
    Do i need to do anything else before that to save it.???
    BTW, how to unzip that folder....??
    Thanks a lot.

    Dear Ken:
    Many many thanks...[?]
    2015-03-08 19:22 GMT+08:00 Ken Binney <[email protected]>:
        how to find "start-dreamweaver-first-website" zip in local site
    folder?  created by Ken Binney
    <https://forums.adobe.com/people/Ken+Binney> in *Dreamweaver support
    forum* - View the full discussion
    <https://forums.adobe.com/message/7264408#7264408>

  • How to find link between the field (kzbew) mvt.ind. and the (ebeln) ?

    Hi all,
    while finding the link between the kzbew and the ebeln the only table i found is MSEG.
    But i want to populate the data in this table only?
    So please give me the solution how i can fetch the movement indicator for a particular purchase order?
    As i am using the idoc segment MBGMCR02((for creating goods receipt)...i have to pass the movt. indicator with the movement type also.......?

    the field - description in MSEG says:
    Movement Indicator
    Specifies the type of document (such as purchase order or delivery note)  that constitutes the basis for the Movement.
    Use
    This indicator is necessary, for example, to enable a distinction to be made between a goods receipt for a purchase order and a goods receipt for a production order. These two goods movements result in different data
    and account updates in the system.
    Dependencies
    The movement indicator is derived from the transaction code.
    what transaction do you want to use for your idoc?

  • How to find the URL of website

    HI,
    My Web hosting company have created the instance of Web Tools in the web server but they are not sure on the URL part when creating the instance. I also do not have privileges to look into the IIS. 
    Does web tools stores the URL information any where? How do I find the URL for that website?
    Thanks in advance for any Suggestions!
    Regards,
    Mohan

    Hi Bryce,
    Thanks for the suggestion!
    I have tried the domain name with folder name ‘WebDemoUK’ created during the website instance creation. The installation path is correct as in the error message. What might be reason for this error?
    Domainname/B1webtools seems to point to old web site.
    Server Error in '/WebDemoUK' Application.
    Configuration Error
    Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
    Parser Error Message: The entry 'connString' has already been added.
    Source Error:
    Line 4:      <add key="PrivateKey" value="OZMwWiKEqv3G1" />
    Line 5:    </appSettings>
    Line 6:    <connectionStrings configProtectionProvider="DataProtectionConfigurationProvider">
    Line 7:      <EncryptedData>
    Line 8:        <CipherData>
    Source File: C:\home\13597\algeosftp\www.foothealthcare.com\WebDemoUK\web.config    Line: 6
    Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832
    Regards,
    Mohan
    Edited by: Rui Pereira on Dec 29, 2008 6:38 PM

  • Confused about how to get link created by website

    I am fallowing a video tutorial on YouTube about how to download a YouTube video as Mp3 file.Once the user typed a YouTube link into
    texbox and clicked the download button The video file is supposed to be download . I think I am doing wrong something .I  think .I am able to get textbox  and button Id like this way
    private void button1_Click(object sender, EventArgs e)
    if (_browser.Document != null)
    var elementById = _browser.Document.GetElementById("youtube-url");
    if (elementById != null)
    elementById.SetAttribute("value", textBox1.Text);
    var htmlElement = _browser.Document.GetElementById("submit");
    if (htmlElement != null)
    htmlElement.InvokeMember("click");
    status = true;
    The problem once the video converted  the web site offers a link to get the video.I need to get the adress written bold charcters.
    How can I do it?
    <a href="/get?video_id=KMU0tzLwhbE&amp;ts_create=1423907396&amp;r=NzguMTc5LjY3Ljg1&amp;h2=4a594985c56edf3bd2da78222a79bdba&amp;s=145591"><b>Download</b></a>
    <a href="/get?video_id=KMU0tzLwhbE&amp;h=-1&amp;r=-1.1" style="display:none"><b>Download</b></a>
    <a href="/get?video_id=KMU0tzLwhbE&amp;ts_create=1423907396&amp;r=NzguMTc5LjY3Ljg1&amp;h2=4a594985c56edf3bd2da78222a79bdba&amp;s=145591"><b>Download</b></a>
    this is the web site  adress

    Hi alak41,
    From your code like following,  since we don't know that the developer how to write the ConvetVideo event in YouTube MP3 website. Maybe you should better ask the website's publishers.
    if (htmlElement != null)
    htmlElement.InvokeMember("click");
    In addition, here is a .NET library, that allows to download videos from YouTube and/or extract their audio track (currently only for flash videos).
    https://github.com/flagbug/YoutubeExtractor/
    Best regadrs,
    kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to find links for the KM resource

    Hi,
    I would like to know the details about the links, which are created for the KM resource.
    I want to search how many links and where these links are created for some perticular resource in KM.
    Please let me know how to achieve this.
    Thanks

    Hello -
    For archive pls refer below
    THere is no standard archive functionality in KM. but you can use time based publishing where you can give validity of the documents. Once the time is expired then automatically it will not display to the end users who have read permissions.
    kept in your directory but it will not visible to enduser (those are having a read access) section.
    So Go to folder (Life time enable on folder level) ---> Details ---> Click on Lifetime --> Enable it
    Afterthat you can select the appropriate file and assign the life time .Here is the process....
    A(file name)-> Details-> Properties ---> lifetime.
    /thread/103302 [original link is broken]
    http://help.sap.com/saphelp_nw70/helpdata/en/8d/2813418366f023e10000000a155106/content.htm
    Regards
    satya

  • How to find linked IDOCs from Archive Sales Orders

    Hi Experts,
        Just would like to know if there's a way to find  IDOCs that is linked to an archive Sales Order. I'm archiving IDOCs base on its Sales Order Document, If the SO doc is already archive then its IDOCs should also be archive.
    Best regards,
        JP

    Hi Mylen,
    Yup... they're linked. Our sales order document are created from an IDOCs. During the archiving of those sales orders, it's related  IDOCs are still left in the system and later archived according to their age and not the status. What I want to do is  to hold  IDocs for as long as the reference sales document (object) is still on the system and archive them if the reference doc has been archived. Thanks for replying.
    Best regards,
       JP

  • How can I link to my website home page other than by referring to it via /index.html.

    Hi,
    I understand that it's better if the home page links within my site resolve to my domain name rather than to domain name and the suffix /index.html.
    This can be achieved by specifying an absolute URL, but is there a better alternative method?
    Advice would be much appreciated.
    Thanks,
    Andy

    The concern is SEO. When Google search links are followed to my home page the URL shows as http://www.mydomain.co uk but when home page links are clicked within the site, the same page shows a URL of http://www.mydomain.co.uk/index.html (the home page id within the site). I've been advised that in both circumstances the URL should ideally be the same. I honestly don't know whether it's something I should be concerned about, but if it's easy to accomplish I'll do it. (There's nothing special about the site, no intro page before the content or anything similar).

  • How to find link between Business partner and Org unit in Solution manager

    Hi experts,
    Please!!!
    I have a requirement where my rule finds business partner assinged for that support team and in transaction ppoma_crm we have org unit assigned to that business partner number below that we have positions and user assigned...
    I can find business partner for the transaction now i need to find the org unit for the assigned business partner so i could use for agent determination in workflow.
    Thanks and Regards
    Annamalai

    do you know? ... the structure is like this... i have orgunit then a position to it and then i have assigned a business partner which is with prefix CP... i m not seeing the users assigned to it so my workflow doesnt get triggered if i use this org unit..
    regards

  • How do I link to a webpage but have it show in a window in my flash page?

    How do I link to a website but have it show inside a window
    or box in my flash website?

    The iPad doesn't support been mounted as a drive - it will only show in Finder if you have photos on it that were taken with it, copied to it via the camera connection kit, or saved from emails/websites.
    You can copy content to/from your iPad's apps either via the file sharing section at the bottom of the device's apps tab when connected to iTunes, via wifi, email, dropbox etc. - whatever the apps that you have on the iPad support.  The iPad doesn't have a file system like a 'normal' computer, everything has to be stored with an app.

  • Find Link between Field, Segment, Idoc

    Hi Experts
    I would like to know how to find link between IDoc, Segment and Fileds.
    For Example : I know field Name Then i wild like to know Which Idoc and segment contain this field name.
    Thanks in advance,
    Jaykumar.M.

    Hi Jayakumar,
    I think this is the same old question on how to find out in what tables a field may be used.
    Segments are DDIC structures. A where-used-list on the data element of the field (eventually with some restrictions on the resulting objects name) should show the segments where is is used. The you can check table EDISEG recursively.
    Regards,
    Clemens

  • How to find the number of links in a website

    hi every body
    can any one clear my doubt
    my doubt is that
    in a website how to find the number of links the hole website contains
    is there any navigation tool to find that
    plz help me yar
    i am waiting for the reply

    If you're talking about commercial sites (sites you don't have the source code for) I'm not sure.
    If you want to count the links in site that you have the source code for, it should be relatively easy to write a Java application to do it. All you really need to do is have a list of the files you want to count links in, read each file line by line and check for the existance of the <a> tag in each line. Anywhere their is an <a> tag there is a link.
    Hope this helps.

  • How do I attach the link to my website?

    Hello-  I want to add a link on my website using the template I created today. How do I do that?   Thanks...

    If I understand you correctly you want to have a link of your fillable form on your website.
    If that is the case you would need to have access to the page you want to add the link to.
    Here is a reference on how to add link to an HTML page : http://www.w3schools.com/html/html_links.asp
    You can get the link of your fillable form on the "Distribute Tab".
    Known that you can also embed the form itself in your website.
    You can find more information about that here : http://forums.adobe.com/docs/DOC-1991
    Hope this helps
    Gen

  • SD-How to find table of link between delivery and sales order?

    Hi Experts,
    I have a requirement as below.
    In LIPS table (SD document: Delivery: Item data), in this table has one kind data.
    One record has maintianed 2 fields PSPNR(Project definition (internal)) and PS_PSP_PNR(Work Breakdown Structure Element (WBS Element)).
    How to find sales order number of the above record? Could you tell me which table link the delivery item data and sales order number?
    Thanks a lot,
    Frank

    Hi frank
    Check the following tables  VBAP , VAPMA , VBUP . It may help you
    Regards
    Srinath

Maybe you are looking for

  • Changed my Apple ID, but iCloud ID no longer works.  How do I get iCloud ID and password to work now?

    I had to terminate my old email address due to excessive SPAM and notes from friends being returned as undeliverable. I set up a new email account at Outlook.com and then changed my Apple Store log-in ID and password (and that works fine).  BUT, iClo

  • SSMS 2012: Using CTE in a query - Invalid column name 'EmployeeID' !!??

    Hi all, From Page 88 of the Book "SQL Programming & Database Design Using Microsoft SQL Server 2012" written by Kalman Toth, I copied the following code of Using CTE in a query: -- CTETest2.sql /// saved in C:\My Documents\SQL Server Management Studi

  • Opening Document Error

    Hi I am unable to open any of the pdf documents on my desk top - I get this error message: There was an error opening this document. The file is damaged and could not be repaired.

  • How do I export an iPhoto album as a pdf?

    How do I export an iPhoto album as a pdf? When I am in the album and go to file --> export, I get each image from the album saved as a separate file. I want to save them all in one file.

  • Calling an standard program

    Hi all, I am coding an Z Program and in this Zprogram i have to call an Standard Program(RFFOUS_T) and after giving the Necessary input Manually in the first selection screen (1000)of the Standard program i have to return back to my Z program How can