我对编程非常陌生,我正在尝试从 IMDB 获取大约 1500 部电影列表中的信息。我找到了一个网站,可以从 XML 文件中获取数据,但我无法获取数据。我想把它写到一个分隔文件中,这样我就可以在访问中导入这整个东西,这样我就可以拥有这些电影的综合 imdb 数据库。到目前为止,这是我的代码。
Imports System.IO
Imports System.Xml
Imports System.Text
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StartButton.Click
Dim bug As String = ""
Dim genre As String = ""
Dim MoviesList() As String
Dim counter As Integer = 0
Dim amirunning As Boolean = True
Dim rating As String = ""
Dim year As String
Dim rated As String
Dim directors As String
Dim writers As String
Dim actors As String
Dim plot As String
MoviesList = {1500 movies in here}
Do While counter < MoviesList.Length And counter <= 0
Label1.Text = MoviesList(counter)
WebBrowser1.Navigate("http://deanclatworthy.com/imdb/?q=" & MoviesList(counter) & "&type=xml")
Dim BookXDocument = XDocument.Load("http://deanclatworthy.com/imdb/?q=" & MoviesList(counter) & "&type=xml")
Dim myquery = From movie In BookXDocument.<movie>
Select movie...<genres>.Value
Dim myquery2 = From movie In BookXDocument.<movie>
Select movie...<languages>.Value
textbox1.text = myquery
counter = counter + 1
Loop
End Sub
End Class
我无法弄清楚如何将 myquery 和 myquery2 值用作字符串!
我在线收到以下错误
textbox1.text = myquery
它返回为“无法将'WhereSelectEnumerableIterator`2 [System.Xml.Linq.XElement,System.String]'类型的对象转换为'System.String'类型。”