Thanks to diafol for putting me wise to the imdb api. Unfortunately, due to my ignorance of all things related to web programming I am stuck. I fetch my information via the following
Dim url As String = "http://mymovieapi.com/?title=@title&type=xml&plot=full&episode=0&limit=1&year=@year&yg=1&mt=M&lang=en-US&offset=&aka=simple&release=simple&business=0&tech=0"
url = Replace(url, "@title", "Star+Trek")
url = Replace(url, "@year", "1979")
WebBrowser1.Navigate(url)
I fetch the result in the Navigated event handler as follows
Dim result As String = WebBrowser1.DocumentText
That's when I run into problems. When I display the value of result in a textbox I get
<HTML><HEAD>
<STYLE>BODY{font:x-small 'Verdana';margin-right:1.5em}
.c{cursor:hand}
.b{color:red;font-family:'Courier New';font-weight:bold;text-decoration:none}
.e{margin-left:1em;text-indent:-1em;margin-right:1em}
.k{margin-left:1em;text-indent:-1em;margin-right:1em}
.t{color:#990000}
.xt{color:#990099}
.ns{color:red}
.dt{color:green}
.m{color:blue}
.tx{font-weight:bold}
.db{text-indent:0px;margin-left:1em;margin-top:0px;margin-bottom:0px;padding-left:.3em;border-left:1px solid #CCCCCC;font:small Courier}
.di{font:small Courier}
.d{color:blue}
.pi{color:blue}
.cb{text-indent:0px;margin-left:1em;margin-top:0px;margin-bottom:0px;padding-left:.3em;font:small Courier;color:#888888}
.ci{font:small Courier;color:#888888}
PRE{margin:0px;display:inline}</STYLE>
<SCRIPT><!--
function f(e){
if (e.className=="ci"){if (e.children(0).innerText.indexOf("\n")>0) fix(e,"cb");}
if (e.className=="di"){if (e.children(0).innerText.indexOf("\n")>0) fix(e,"db");}
e.id="";
}
function fix(e,cl){
e.className=cl;
e.style.display="block";
j=e.parentElement.children(0);
j.className="c";
k=j.children(0);
k.style.visibility="visible";
k.href="#";
}
function ch(e){
mark=e.children(0).children(0);
if (mark.innerText=="+"){
mark.innerText="-";
for (var i=1;i<e.children.length;i++)
e.children(i).style.display="block";
}
else if (mark.innerText=="-"){
mark.innerText="+";
for (var i=1;i<e.children.length;i++)
e.children(i).style.display="none";
}}
function ch2(e){
mark=e.children(0).children(0);
contents=e.children(1);
if (mark.innerText=="+"){
mark.innerText="-";
if (contents.className=="db"||contents.className=="cb")
contents.style.display="block";
else contents.style.display="inline";
}
else if (mark.innerText=="-"){
mark.innerText="+";
contents.style.display="none";
}}
function cl(){
e=window.event.srcElement;
if (e.className!="c"){e=e.parentElement;if (e.className!="c"){return;}}
e=e.parentElement;
if (e.className=="e") ch(e);
if (e.className=="k") ch2(e);
}
function ex(){}
function h(){window.status=" ";}
document.onclick=cl;
--></SCRIPT>
</HEAD>
<BODY class="st"><DIV class="e">
<SPAN class="b"> </SPAN>
<SPAN class="m"><?</SPAN><SPAN class="pi">xml version="1.0" encoding="utf-8" </SPAN><SPAN class="m">?></SPAN>
</DIV>
<DIV class="e">
<DIV class="c" STYLE="margin-left:1em;text-indent:-2em"><A href="#" onclick="return false" onfocus="h()" class="b">-</A>
<SPAN class="m"><</SPAN><SPAN class="t">IMDBDocumentList</SPAN><SPAN class="m">></SPAN></DIV>
<DIV><DIV class="e">
<DIV class="c" STYLE="margin-left:1em;text-indent:-2em"><A href="#" onclick="return false" onfocus="h()" class="b">-</A>
<SPAN class="m"><</SPAN><SPAN class="t">item</SPAN><SPAN class="m">></SPAN></DIV>
<DIV><DIV class="e"><DIV STYLE="margin-left:1em;text-indent:-2em">
<SPAN class="b"> </SPAN>
<SPAN class="m"><</SPAN><SPAN class="t">rating</SPAN><SPAN class="m">></SPAN><SPAN class="tx">6.3</SPAN><SPAN class="m"></</SPAN><SPAN class="t">rating</SPAN><SPAN class="m">></SPAN>
</DIV></DIV>
<DIV class="e"><DIV STYLE="margin-left:1em;text-indent:-2em">
<SPAN class="b"> </SPAN>
<SPAN class="m"><</SPAN><SPAN class="t">rating_count</SPAN><SPAN class="m">></SPAN><SPAN class="tx">37814</SPAN><SPAN class="m"></</SPAN><SPAN class="t">rating_count</SPAN><SPAN class="m">></SPAN>
</DIV></DIV>
<DIV class="e"><DIV STYLE="margin-left:1em;text-indent:-2em">
<SPAN class="b"> </SPAN>
<SPAN class="m"><</SPAN><SPAN class="t">year</SPAN><SPAN class="m">></SPAN><SPAN class="tx">1979</SPAN><SPAN class="m"></</SPAN><SPAN class="t">year</SPAN><SPAN class="m">></SPAN>
</DIV></DIV>
<DIV class="e"><DIV STYLE="margin-left:1em;text-indent:-2em">
<SPAN class="b"> </SPAN>
<SPAN class="m"><</SPAN><SPAN class="t">plot</SPAN><SPAN class="m">></SPAN><SPAN class="tx">An alien phenomenon of unprecedented size and power is approaching Earth, destroying everything in its path. The only starship in range is the USS Enterprise--still in drydock after a ma
However, the actual text displayed in the WebBrowser control (which is what I want for parsing) is
<?xml version="1.0" encoding="utf-8" ?>
- <IMDBDocumentList>
- <item>
<rating>6.3</rating>
<rating_count>37814</rating_count>
<year>1979</year>
<plot>An alien phenomenon of unprecedented size and power is approaching Earth, destroying everything in its path. The only starship in range is the USS Enterprise--still in drydock after a major overhaul. As Captain Decker readies his ship and his crew to face this menace, the legendary Admiral James T. Kirk arrives with orders to take command of the Enterprise and intercept the intruder. But it has been three years since Kirk last commanded the Enterprise on its historic five year mission... is he up to the task of saving the Earth?</plot>
- <genres>
<item>Action</item>
<item>Adventure</item>
<item>Mystery</item>
<item>Sci-Fi</item>
</genres>
<rated>G</rated>
<title>Star Trek: The Motion Picture</title>
<imdb_url>http://www.imdb.com/title/tt0079945/</imdb_url>
- <directors>
<item>Robert Wise</item>
</directors>
- <writers>
<item>Gene Roddenberry</item>
<item>Alan Dean Foster</item>
<item>and 1 more credit</item>
</writers>
- <actors>
<item>William Shatner</item>
<item>Leonard Nimoy</item>
<item>DeForest Kelley</item>
<item>James Doohan</item>
<item>George Takei</item>
<item>Majel Barrett</item>
<item>Walter Koenig</item>
<item>Nichelle Nichols</item>
<item>Persis Khambatta</item>
<item>Stephen Collins</item>
<item>Grace Lee Whitney</item>
<item>Mark Lenard</item>
<item>Billy Van Zandt</item>
<item>Roger Aaron Brown</item>
<item>Gary Faga</item>
</actors>
<plot_simple>When a destructive space entity is spotted approaching Earth, Admiral Kirk resumes command of the Starship Enterprise in order to intercept, examine and hopefully stop it.</plot_simple>
<type>M</type>
<poster>http://ia.media-imdb.com/images/M/MV5BMTQ5MzM5ODk5OV5BMl5BanBnXkFtZTcwNDY1NDYyMQ@@._V1._SY317_.jpg</poster>
<imdb_id>tt0079945</imdb_id>
- <also_known_as>
<item>Star Trek: The Motion Picture - The Director's Edition</item>
</also_known_as>
- <language>
<item>English</item>
<item>Klingon</item>
</language>
- <country>
<item>USA</item>
</country>
<release_date>19791207</release_date>
<filming_locations>Paramount Studios - 5555 Melrose Avenue, Hollywood, Los Angeles, California, USA</filming_locations>
- <runtime>
<item>132 min</item>
<item>USA: 136 min (director's cut)</item>
<item>USA: 143 min (TV version)</item>
</runtime>
</item>
</IMDBDocumentList>
How do I get at the actual WebBrowser XML data? Bonus question - why is result truncated to 4095 characters (a very suspicious number, indeed)?