Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

C# select elements in a web browser


deathtaker26
 Share

Recommended Posts

hi i'm writing a program for my job and in doing so I've reached a problem. I need to know how to select text inside a web browser kinda like using ctrl + f to find something. the reason i can't just use ctrl + f is because the program has to search for key words on it's own then click the link that the selected text takes them too. It's kinda like a spider. Can someone please help me out with this?
Link to comment
Share on other sites

Okay I have never heard of regular expressions I have just researched it and from what I understand it just searches for things by patterns and whether they are like numeral or alphabetic. But this program has to find the PERFECT parts of it. I'm being payed a lot of money for this and they need everything 100% perfect meaning 0 bugs and because the program visits 1000's of different pages it would be hard to take out specifics such as patterns to point things out cause each page has a different html source.
Link to comment
Share on other sites

@Crest:

> Okay I have never heard of regular expressions I have just researched it and from what I understand it just searches for things by patterns and whether they are like numeral or alphabetic. But this program has to find the PERFECT parts of it. I'm being payed a lot of money for this and they need everything 100% perfect meaning 0 bugs and because the program visits 1000's of different pages it would be hard to take out specifics such as patterns to point things out cause each page has a different html source.

If your being payed allot of money they assume you now this stuff…
Use regular expressions, it's the only real way. http://gskinner.com/RegExr/
Link to comment
Share on other sites

@Mr.:

> If your being payed allot of money they assume you now this stuff…
> Use regular expressions, it's the only real way. http://gskinner.com/RegExr/

well what I was doing was using parts that are similar within all the sources of every page on yellowpages.com here just look for yourself
```
  // Gets Page Source
          string source = Functions.RetrieveSource(webBrowser1.Url.ToString());

            //Collects Company Phone Number
          int StartInd = source.IndexOf("

") + 17;
          int EndInd = source.IndexOf("
" ) - 4 ;
          source = source.Substring(StartInd, source.Length - StartInd);

I'm actually working on this part now it's why it's not done….

```
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...