Hi all,
I'm trying to get the megavideo url from this page : http://www.alloshowtv.com/series/view_s.php?idep=70188&cat=S&id=168

In my browser, the link is called "Voir cette vidéo sur MegaVideo" (in french)

The problem is thta the link doesn't appear in the HTML source (when i use a httpwebrequest)
There's a element called iframe and I don't how to fetch it.

thanks for your help

Recommended Answers

All 9 Replies

I looked at the webpage and wrote the following snippet to help you find your "iFrame" tag and "MegaVideo" name--it is not tested! It assumes you will have already loaded/navigated to the page in your webBrowser control. Anyway, I hope this helps:

HtmlDocument doc = webBrowser.Document;
                if (doc == null)
                    return null;

                // Get collection of all tags on page with given name
                HtmlElementCollection collect = doc.GetElementsByTagName("iFrame");

                // Loop through each element and find attribute you want
                foreach (HtmlElement element in collect)
                {
                    // if looking for "name" attribute
                    if (element.GetAttribute("name").ToLower() == "megavideo")
                    {
                        value = element.GetAttribute("src"); // "megavideo.php?id=70188"
                        break;
                    }
                }

Thanks for your reply but I don't use webBrowser control.
I just want to retrieve the URL of the megavideo link in a c# string variable.
When I go to this page with firefox (or ie) I can see that it is http://www.megavideo.com/?v=QJANIB2O

But in the HTML code, this seems to be hiden.

Thanks for your reply but I don't use webBrowser control.
I just want to retrieve the URL of the megavideo link in a c# string variable.
When I go to this page with firefox (or ie) I can see that it is http://www.megavideo.com/?v=QJANIB2O

But in the HTML code, this seems to be hiden.

How are you opening the webpage to search for the URL if not in a WebBrowser control? I don't know how to help you if I don't know what you are doing.

OK maybe I was not clear, I'm sorry.
I don't want to open the page, I just want my c# application to retrieve the url with a simple code like that :

HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create("http://www.alloshowtv.com/series/view_s.php?idep=70188&cat=S&id=168");
WebResponse resp = req.GetResponse();
Stream s = resp.GetResponseStream();
string result = new StreamReader(s).ReadToEnd();

Next I need to get the megavideo url.
The problem : it is not include in the string result.

When I view that page, I see the text you said was in french, and their is no link. Can you translate to me this text, and do you see an actual link to a URL when you browse the page? I hope there are not bad words in here.

Pour ceux qui ont déjà pris un compte premium chez MegaVideo, SVP arrêtez de m'écrire à ce propos car ce site est indépendant du site MegaVideo.
Si vous avez des problèmes : Logez-vous avec votre compte premium sur le site MegaVideo puis utilisez le lien [[B]Voir cette vidéo sur MegaVideo[/B]] en bas du lecteur MegaVideo de notre site.
On n'encourage pas nos visiteurs à prendre un compte premium MegaVideo/MegaUpload pour la simple raison que les vidéos de cette plateforme sont supprimées fréquemment.

FYI: I also browsed "result" from GetResponseStream, and did not see any reference to megavideo that looked like a URL for it.

The text you selected is saying that to play the video with no time restriction, we have to log into megavideo with our premium account.

I discover that the embedding player as well as the megavideo link is coded in the HTML source as

<td bgcolor="#000000"><iframe src="megavideo.php?id=70188" name="megavideo" id="megavideo" width="100%" height="440"  align="center" Frameborder="0" Scrolling="no" ></iframe></td>

So I've tried to parse the page :
http://www.alloshowtv.com/series/megavideo.php?id=70188
but I get a strange response (I think it's a java script)
If you try with fiefox, it redirects to the home page

Yea, I've seen what you describe and I don't know how to help you. Maybe someone will see this more descriptive information and have a trick they can share.

ok thx
hope someone will help me.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.