Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. How to import URLs from Google page to listview

How to import URLs from Google page to listview

Scheduled Pinned Locked Moved C#
questionhelptutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rajendra Rana
    wrote on last edited by
    #1

    I have retrived an web page content in one text box, now I want to retrive URLs from that content.So how can I do this.because different URLs have different Length and patterns so I am in trouble.Can any body help me? Raj

    S 1 Reply Last reply
    0
    • R Rajendra Rana

      I have retrived an web page content in one text box, now I want to retrive URLs from that content.So how can I do this.because different URLs have different Length and patterns so I am in trouble.Can any body help me? Raj

      S Offline
      S Offline
      Somanova420
      wrote on last edited by
      #2

      you have to use regular expressions for something like this. using System.Text.RegularExpressions; string linkPattern = "href\s*=\s*(?:""(?[^""]*)""|(?\S+))"; Regex linkRegex = new Regex(linkPattern, RegexOptions.IgnoreCase | RegexOptions.Compiled); Match linkMatch = linkRegex.Match(page); //where page == your web content while(linkMatch.Success) { //link is the url now. string link = linkMatch.Groups(1).Value.ToString(); .... //do what you need to do linkMatch = linkMatch.NextMatch(); } -- modified at 16:10 Monday 13th March, 2006

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups