Thursday, 6 July 2006
|
| Screen scraping a web page Dan 21:46:28 |
| | Hi,
I run several websites and I am looking to write a VB program that will access certain page son my sites and then either screen-scrape the contents of the page, or alternatively, save the contents of the page to a local text file that I can then parse.
These pages, are raw statistic outputs such as visitors, sign-ups,purchases etc and are all generated by PHP.
As I seem to spend several hours each day refreshing my stats screens I am looking to write a VB program that will, every 5 minutes or so, access each of these special pages, scrape the contents and the displayed the information on my application.
My question is, does anyone have any simple source code that accesses a web page and saves the contents to a local file.
Many thanks
Dan
|
| | 1 answer | Add comment |
|
| Create pictures array in run time Guest 12:07:52 |
| | Hi folks! I have a PictureBox control named Pic1 in a form. In run time I would like to create new instances of this Pic1 ex: Pic1(1), Pic1(2), Pic1(3)....depemding on number of pictures I need to put in the form. How to do it? Thanks
|
| | 12 answers | Add comment |
|
| My question Anbulla Aswin 07:24:17 |
| | How to play an mp3 inside a form in vb 6.0? please help
|
| | 3 answer | Add comment |
|
| calling a C function Dave Houston 06:23:46 |
| | I need to call a function (written in C) from VB4-32. The C definition is...
int CALLBACK ZXDownloadWnd(const char *file, long port, long flags, HWND hWnd, UINT mesg, long lParam)
Can anyone show me how to DECLARE this in VB4-32?
|
| | 2 answer | Add comment |
|
| Trying to get elements from a web page via VB Newbie@gmail.com 01:13:46 |
| | I am attempting to write a little utility to check my mail at Yahoo.
I found an older posting that shows how to get the elements from a web page via VB using the browser control.
When I tried to use this code, I have problems.
WB.Document.All(i).Type generates this error "Object doesn't support this action"
and
WB.Document.All(i).Value generates the same error.
However, WB.Document.All(i).TagName and WB.Document.All(i).OuterText work fine.
WB is the WebBrowser on the form.
Please tell me what I am doing wrong. When I typed the "." after WB, I got the list of all properties, but when I put the "." after document, I did not see the properties of the document so I typed All(i) and then ran it to no avail.
Private Sub cmdCheckMail_Click() Dim i As Integer WB.Navigate txtURL.Text Do DoEvents If WB.Busy = False Then Exit Do Loop On Error Resume Next For i = 0 To WB.Document.All.Length - 1 txtNotes.Text = txtNotes.Text & WB.Document.All(i).TagName & vbCrLf txtNotes.Text = txtNotes.Text & WB.Document.All(i).OuterText & vbCrLf txtNotes.Text = txtNotes.Text & WB.Document.All(i).Type & vbCrLf
txtNotes.Text = txtNotes.Text & WB.Document.All(i).Value & vbCrLf Next End Sub
Private Sub Form_Load() txtURL.Text = "https://login.yahoo.com/config/mail?.intl=us" End Sub
I have copied the old posting below.
Thans for any help you can give.
WebBrowser1.Document.All will hold every element in a HTMP document.>You will wish to make a note of which element(s) are the form's text>boxes, and which element(s) are the form's buttons. Since a form>generally has only one "submit" button, but may have many text boxes,>you will need to write dowen (perhaps on a piece of paper) which>elements you are working with.> To list the elements, first navigate to the web site (via URL) in>question and then run a script to list the elements.> Private Sub Command1_Click()> Dim i As Integer> Open "C:\temp\Element-list.txt" For Output As #1> On Error Resume Next> For i = 0 To WebBrowser1.Document.All.length - 1> Debug.Print i, "Tag Name: ";>WebBrowser1.Document.All(i).TagName> Debug.Print i, "Text: "; WebBrowser1.Document.All(i).OuterText> Debug.Print i, "Type: "; WebBrowser1.Document.All(i).Type> Debug.Print i, "Value: "; WebBrowser1.Document.All(i).Value> Debug.Print> Print #1, i, "Tag Name: "; WebBrowser1.Document.All(i).TagName> Print #1, i, "Text: "; WebBrowser1.Document.All(i).OuterText> Print #1, i, "Type: "; WebBrowser1.Document.All(i).Type> Print #1, i, "Value: "; WebBrowser1.Document.All(i).Value> Print #1, ""> Next> Close>End Sub> For the text boxes, you are looking for the elements called "OPTION".>You will wish to fill those elements with the Value property> WebBrowser1.Document.All(-the-number-).Value = "Hello World"> For the submit button, you probably want the last "INPUT" element,>however if the HTML form has buttons after the button you want, you>will have to determine the actual element number. Once you find that>element number, you may use the .Click method to "push" that button.> WebBrowser1.Document.All(-the-number-).Click> In the example above, the holysmoke.org web page has HTML form with a>text box at element 121. The submit button is element 122. If I wanted>to fill out that text box I would add the line to my code:> WebBrowser1.Document.All(121).Value = "Bob Minton"> Then to submit that form, I would add:> WebBrowser1.Document.All(122).Click> Do> DoEvents> If WebBrowser1.Busy = False Then Exit Do> Loop |
| | 6 answers | Add comment |
|
| Help Emailing File attachment Please Jem 00:41:33 |
| | Hi
I use the following code for sending an email from a link on a VB form, Or should I say opening a window ready to send the email...
######################################################
'Declarations etc for Email link Public Const SW_SHOWNORMAL As Long = 1
Public Declare Function ShellExecute Lib "shell32" _ Alias "ShellExecuteA" _ (ByVal hwnd As Long, _ ByVal lpOperation As String, _ ByVal lpFile As String, _ ByVal lpParameters As String, _ ByVal lpDirectory As String, _ ByVal nShowCmd As Long) As Long 'End of declarations for Email link
Dim m_Subject As String, m_Body As String m_Subject = "Lens Stock Ordering Technical Support Request " & Date m_Body = "Please add your contact details and message here..." ShellExecute 0, "open", "mailto:support@anything.co.uk?Subject=" & m_Subject & _ "&Body=" & m_Body, 0&, 0&, SW_SHOWNORMAL
########################################################
Is there an easy way to alter this code so that it sends a text file (EDI.txt - resident in the App's dir) as an attachment?
Can the process be fully automated so that the email goes straight into the users outbox awaiting their next send/receive?
Better still can a send/receive command be initiated without the users intervention?
I'm very much a novice at programming and easily get stuck/confused/frustrated etc
Any help, code snippets etc that will help me do this would be very much appreciated.
Many thanks
Jem
|
| | Add comment |
Wednesday, 5 July 2006
|
| Command Button appearance [in grand style] Tony 22:01:28 |
| | i am more of a web site programmer than vb programmer. I simply hate the vb toolbar, so i built a toolbar using html, jscript...since i can communicate both ways from jscript embedded in webpage to vb embedding IE. I create my buttons, images...on a page and embed it into my form, so when i click the image or button, vb responds. To make this easy, i converted the project into an activex control. Only thing i have not made is to design a property page to allow you to add items into the activex/usercontrol at design time. u must add items using notepad, or web page editors. The integration wit vb is similar to the toolbar, the control has a click event... If you want a sample code on this, i will be happy to send it, just post me an e-mail at <a href="mailto:diltony@yahoo.com">diltony@yahoo.com</a>
|
| | Add comment |
|
| Create pictures array in run time in a listbox Tony 21:54:57 |
| | If you wish to create the pictures into a listbox, you might consider using the msflexgrid control as it can load pictures into any of the list items... Don't ask me how, i only used this control once, and i will have to search my archives for the sample code...
|
| | Add comment |
|
| Command Button appearance Jim Y 20:25:31 |
| | Is it possible to make a Flat command button? I tried changing from 3D to flat and style/graphical and neither did the job. What I would like to try is have a flat, no border, graphical command button on which I can make the back color the same as the form. On the command button I would place a graphic of some design with the name (Exit, etc.). In this fashion only the graphic would display for the button. I know from professional software it has been done, but can I do it with VB6 SP6 enterprise?
Thank you, Jim Y
|
| | 8 answers | Add comment |
|
| Iterate through an enumeration Fernando RodrГguez 19:13:37 |
| | Hi,
Is there a way to iterate through an Enum, "a la" Foreach ?
Thanks
|
| | 4 answer | Add comment |
|
| object data type Vballmatt 15:31:47 |
| | Is there a way that I can declare a variable as a class variable? For example, I'd like to say
Dim a As class (or whatever it is called),
then be able to say
Dim b As a
so that b is of type a? Is this possible? If so, how?
|
| | 3 answer | Add comment |
Tuesday, 4 July 2006
|
| Shape control with Labels, Text Boxes & Command Buttons Jim Y 21:47:49 |
| | I have a form that has labels, text boxes, command buttons, etc. and I would like to block off certain areas of the form with a specific back ground color. I tried using the Shape Control without success. I can create the shape in the color that I want and "slide" it beneath the command buttons and text boxes. The shape does not go beneath the labels. It covers them. Is there a way in which I can force the shape beneath the labels without re-doing the form?
Using a new (test) form, I created the shape first then added a label, text box and command button. That worked. I saved the test program and left the house for a while. Returning home, I added another shape to the test form. "Sliding" it beneath (?) the existing objects just covered the label again. That surprised me because when I first tried the test form (and before saving it), I was able to "slide" the shape beneath the label.
Thank you, Jim Y
|
| | 11 answers | Add comment |
|
| Use Strings as variable names Chris 21:39:22 |
| | In my VB program I have a couple of text boxes called T11,T12,T13 and T14... and so on. When i run the program I want to enter numbers into these boxes and then click a button that would put the data from these boxes into an array. Is there a quick way for me to call up these text boxes using string cancatenation rather than hard coding them since i have a lot of text boxes which i have data to put in an array.
for example like this. A=11 Array1(X,Y)= T & A A=A+1
|
| | 3 answer | Add comment |
|
| MS word track changes Ranka_76 19:09:18 |
| | Hi there,
I want to write a macro in VB for MS word.
1. Macro should extract the deleted/added text (when track changes are enabled in MS word).
2. I also want to locate the location of current selected paragraph (eg page number, section, heading, sub heading).
Please suggest how to do these two.
Thanks,
|
| | 2 answer | Add comment |
|
| VB6 Prerequisites Jens Lenge 12:33:37 |
| | Hello World,
what exactly needs to be installed on a Win2000/XP computer to make programs run that were created with VB6?
I have found and installed the "Microsoft Visual Basic 6.0 SP6 Runtime" (vbrun60sp6.exe), but this does not work - the VB6 program still claims that some OCX is missing.
Isn't there some "complete" installation package that I can install on a certain PC to make all VB6 programs run? Or what else can I do?
Jens
|
| | 4 answer | Add comment |
Monday, 3 July 2006
|
| qodbc driver Wesley 12:53:39 |
| | Hi guys, i am looking for a qodbc driver so that i can talk to the quickbooks database. Any recommendations? Thanks Wes
|
| | 2 answer | Add comment |
|
| Re: Rich text boxes - stopped working - thanks John E. Fox 00:16:03 |
| |
That's fixed it! Thanks very much for your help.
John Fox
Dear All,> I have just upgraded MS Office to 2003 and found that I can no longer > use Rich Text Boxes in Visual Basic. I get an error message saying 'You > do not have a license for this application' or that I no longer have > ActiveX installed.> Any ideas please.> All the software is 100% legal from the original CDs> thanks in advance.> John Fox |
| | Add comment |
Sunday, 2 July 2006
|
| Rich text boxes - stopped working John E. Fox 16:15:44 |
| | Dear All,
I have just upgraded MS Office to 2003 and found that I can no longer use Rich Text Boxes in Visual Basic. I get an error message saying 'You do not have a license for this application' or that I no longer have ActiveX installed.
Any ideas please.
All the software is 100% legal from the original CDs
thanks in advance.
John Fox
|
| | 2 answer | Add comment |
|
| Send file to CD burning Queue Will 12:50:50 |
| | I want to create a backup command which will send a copy of a file (database) to the CD Burner queue. Nothing too complicated, I'm hoping that Windows will prompt for the burning process to continue after that. I've heard there is a special folder that Windows queues files for burning.
|
| | Add comment |
Friday, 30 June 2006
|
| using string as Array Index Dan 20:08:15 |
| | I was wondering if anyone knew how to use a string as an array index. what I mean is that normally one would use a number such '5' as the array index, and that would call a value from the array:
dim example(5) as string example(5) = "bob"
lable1.caption = example(5)
but what I want to do is use a string as the index. So you would use a value such as "bob" and that would call a value from the array:
dim example() as string example('test') = "something"
label1.caption = example('test')
I can think of a number of roundabout ways to do this such as using a two dimentional array and then searching for the passed index in one column of the array, when it is found go to the next column and there is your value. Is there any other way to do this?
Any and all help is appreciated
Dan
|
| | 6 answers | Add comment |
|
| Using GZip decompression in VB 6 Guest 19:13:42 |
| | Please note this request is also posted to the group: microsoft.public.vb.general.discussion.
I am looking for a way to add gzip support to a VB6 Application. I have written an application that contains .zip support an dhave been informed that .gz support is also required.
i would be most grateful for any pointers
regards
Sean
|
| | 6 answers | Add comment |
|
| Static class variables E Hobsbawm 06:33:36 |
| | I am using VB6 in Excel and have just started using classes for some things. I have defined a class "mydata" which essentially holds an variant(60) array with values.
To be able to set or get individual values in the array, I have also defined const fieldlist = "fieldname1, fieldname2, fieldname3, fieldname4 ...." in the header of the class module. I am not certain that this is right way to do things.
Does this create a new fieldlist for every object of class "mydata"? I would like to create it as a static constant string so it is shared among all objects, but I have not found any way to do that.
Best Regards Eric
|
| | 1 answer | Add comment |
Thursday, 29 June 2006
|
| Problem with COM port code Guest 18:42:54 |
| | Hi all,
I have been using the 'COM Port Sample' which is provided with MS VB 2005 Express Edition (RS232.vb), and I only seem to be able to get it to function with com ports up to COM9. Any suggestions on how to make it work with higher com port numbers?
Thanks,
Reuben
|
| | Add comment |
|
| Help with textbox control and timer please Pie 14:15:27 |
| | Is it possible to do something like:
If the text in the textbox1.text changes then timer1.enable=true otherwise timer1.enabled = false and continuously monitors textbox1.text to see if there is any change and repeats.
I know it's a silly question, but I've reached a dead end. Thanks.
|
| | 3 answer | Add comment |
|