Im writing a program in VB.net that consists of three main steps:
STEP 1: Display the source code of a webpage that is streaming a movie on it in textbox1.
STEP 2: highlight the URL to that movie in the source code, and then display just the URL in textbox3.
STEP 3: Download that movie using HttpWebRequest and HttpWebResponse to a user defined directory
The problem is that i dont know how i would go about extracting the URL from the source code effectively. maybe i could try searching the source code for the string ".mp4" or ".avi" or other video extensions, but that would only find the end of the link, how would i highlight the whole link?
For example: if i searched the source code for ".mp4" and there was a URL such as
"http://megavideo.com/g7987bfd0fg.mp4"
then i would only get
"http://megavideo.com/g7987bfd0fg .mp4"
i know there is some way to start at a certain character in a document and go forward or backward a few characters, but the problem arises when you dont know how many characters to go back due to varying lengths of URLs... is there some way that you could search for http:// and then search for .mp4 and then highlight everything in between them?
#EDIT# I also need to be able to feed this URL into another process that will download the file using "httpwebrequest" and "httpwebresponse" so it would be ideal if i could do something like:
textbox3.text = extracted link
Thanks in advance!