Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 2012 > Visual Basic 2012 General Discussion
|
Visual Basic 2012 General Discussion For any discussions about Visual Basic 2012topics which aren't related to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2012 General Discussion section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 16th, 2012, 07:56 PM
Registered User
 
Join Date: Dec 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Question How do I copy info from Wikipedia table to combo boxes? - Really annoying me..

need to somehow copy the number of seasons and episodes in each season from a Wikipedia table into two combo boxes. One for seasons and the other for episodes. The apps supposed to allow the user to type in their favorirte show in the top input box.
Then fill the first combo box with the number of seasons and when the user selects one the relevant number of episodes are shown

<img src="http://www.vbdotnetforums.com/attachments/windows-forms/3553d1355695323-how-do-i-copy-info-wikipedia-table-combo-boxes-really-annoying-me-untitled.png">

My code so far is here

Public Class Form1
Dim Search As String
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
Search = TextBox1.Text
Search = Search.Replace(" ", "+")
Search = "http://www.google.com/search?btnI=I'm+Feeling+Lucky&q=" & Search & "episode+list+wikipedia"


If Asc(e.KeyChar) = 13 Then


WebBrowser1.Navigate(Search)
TextBox1.Text = Search




End If
End Sub
End Class
 
Old December 17th, 2012, 11:20 AM
Registered User
 
Join Date: Dec 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

So far I've found out howto download the page source even manipulate the page a little but I don't know how to use this to get the number of seasons and episodes in each season into combo boxes. Any help would be great thanks

Code:

Imports System.Text.RegularExpressions

Public Class Form1
Dim sourcecode As String
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
sourcecode = ((New Net.WebClient).DownloadString("http://en.wikipedia.org/wiki/List_of_House_episodes#Series_overview_and_ratings "))

Dim Code As String
Dim Information As MatchCollection = Regex.Matches(sourcecode, "<td>(.*?)</td>", RegexOptions.None)
For Each Info In Information
Code = Regex.Replace(Info.ToString, "td>", "", RegexOptions.None)
Code = Regex.Replace(Code, "</td>", "", RegexOptions.None)
MsgBox(Code)
Next
End Sub
End Class





Similar Threads
Thread Thread Starter Forum Replies Last Post
3 combo boxes ttkt Beginning PHP 0 July 2nd, 2005 02:20 PM
Combo boxes socoolbrewster Access 1 March 4th, 2004 09:28 AM
Combo Boxes tjs206 VB Databases Basics 2 December 10th, 2003 05:20 PM
Combo Boxes tjs206 VS.NET 2002/2003 7 November 7th, 2003 04:45 PM
Combo Boxes Louisa Beginning VB 6 2 September 10th, 2003 09:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.