Quantcast
Channel: htmlagilitypack Forum Rss Feed
Viewing all articles
Browse latest Browse all 655

New Post: Problem with Page.DownloadImage

$
0
0

The following code worked fine with Wikipedia several months ago.  It now throws a 404 exception during the DownloadImage call.  I have tried several things to fix it but with no success.   Could anyone point me in the right direction?

    ' Load the basic game information
    Dim p As New Page(wikiSite, pageName)
      p.Load()

    ' Now save the screenshots into the temp directory

    For Each tempFile As String In Directory.GetFiles(currentState.TempDirectory)
      File.Delete(tempFile)
    Next

    Dim gameImages() As String = p.GetImagesEx(True, True)
    screenshotList.Clear()
    screenshotIndex = 0
    boxArtIndex = 0

    For I As Integer = 0 To gameImages.Length - 1
      Try
        Dim imagePage As New Page(wikiSite, gameImages(I))
        Dim screenshotPath As String = currentState.TempDirectory & "\" & I.ToString & ".png"
        imagePage.DownloadImage(screenshotPath)
        screenshotList.Add(screenshotPath)
      Catch
        ' Continue if a particular image can't be found
      End Try
    Next


Viewing all articles
Browse latest Browse all 655

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>