Hi;
I have virtually no Web or HTML programming experience though I am
capable of VB, Basic and and a few other programming languages.

What I was trying to get some help on would be a simple program or
script that I could run that would allow me to retrieve info from a
site that when I have multiple queries. For example I am at site
GoJoe.com (example only) and if I want to get the detail data on recipe

xyz i have to put in a field xyz and when the page refreshes I then
select "get detail recipe" link which then asks me if I want to save
the text file to my pc. Which I respond yes to and then it saves. This

is great but the problem is if I have 20 or 30 reciepies I have to go
through this loop for every one.


I there a simple script that I could get to read a txt file that would
have the recipes already loaded in like (xyz, abc, mno, etc....) that
would read the recipe, then go to the address that I would have gone to

when I click "get detail recipe", have it pull the detail information
and save it automatically to my PC. Complete this until the txt file
runs to it's end.


Sounds relatively simple it's just I don't have the Web develop skills
for the code. Can anyone offer some starter help with this? I'm sure
I could debug things once I got started.


Thanks in advance for any help.


Dave

Re: Any Help to get me started would be appreciated..... by McKirahan

McKirahan
Wed May 10 19:24:37 CDT 2006

"dave" <markie@htva.net> wrote in message
news:1147302075.926792.83530@g10g2000cwb.googlegroups.com...
> Hi;
> I have virtually no Web or HTML programming experience though I am
> capable of VB, Basic and and a few other programming languages.
>
> What I was trying to get some help on would be a simple program or
> script that I could run that would allow me to retrieve info from a
> site that when I have multiple queries. For example I am at site
> GoJoe.com (example only) and if I want to get the detail data on recipe
>
> xyz i have to put in a field xyz and when the page refreshes I then
> select "get detail recipe" link which then asks me if I want to save
> the text file to my pc. Which I respond yes to and then it saves. This
>
> is great but the problem is if I have 20 or 30 reciepies I have to go
> through this loop for every one.
>
>
> I there a simple script that I could get to read a txt file that would
> have the recipes already loaded in like (xyz, abc, mno, etc....) that
> would read the recipe, then go to the address that I would have gone to
>
> when I click "get detail recipe", have it pull the detail information
> and save it automatically to my PC. Complete this until the txt file
> runs to it's end.
>
>
> Sounds relatively simple it's just I don't have the Web develop skills
> for the code. Can anyone offer some starter help with this? I'm sure
> I could debug things once I got started.

The source for a Web page can be retrieved then parsed and saved.
However, the task you described requires customization.
Can you provide a specific example of a site and the results desired?



Re: Any Help to get me started would be appreciated..... by mr_unreliable

mr_unreliable
Thu May 11 12:04:14 CDT 2006

This is a multi-part message in MIME format.
--------------010502000504010601040709
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

hi Dave,

I have attached a sample script, which will get online and
download the daily "Dilbert" cartoon from the Dilbert website.

Your script to retrieve some other stuff from some other site
would probably look similar to this example.

cheers, jw
____________________________________________________________

You got questions? WE GOT ANSWERS!!! ..(but,
no guarantee the answers will be applicable to the questions)



--------------010502000504010601040709
Content-Type: text/plain;
name="wshDilbertRipper_09June03.vbs.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="wshDilbertRipper_09June03.vbs.txt"

' wshDilbertRipper, jw 08June03
'
' --- description block --------------------------
'
' Title: "Dilbert Ripper" (get daily "Dilbert" cartoon)...
'
' Description: this script will get online, and download the
' daily cartoon, as published on the "Official Dilbert"
' website...
'
' Author: mr_unreliable
' Website: none at present
'
' Usage: Use at you own risk, tested on win98se...
'
' --------------------------------------------------------
' Full Disclosure: this script is a DOUBLE plagerization.
' --------------------------------------------------------
' The notion of "ripping" the Dilbert cartoon was
' provided by "Mr. Brownstone", as found on his
' "Virtual Conspiracy" website, (www.virtualconspiracy.com).
' But, Mr. Brownstone's script was written in Perl (ugh!).
' This script (vbScript) was adapted from a demo script
' written by Michael Harris (with subsequent modifications
' by Paul Randall), and found on the vbScript newsgroup...
'
' --- revision history ---------------------------
' 08June03: original attempt...
' 09June03: uh-oh. It (now) appears that the weekday dilbert is
' a gif, but the Sunday dilbert is a jpg (maybe to include color?).
' Anyway, that requires some "adjustments"...
' 09June03: uh-oh. It (now) appears that the filename for the graphic
' is NOT a consistent number of characters, (maybe to throw off
' rippers?). Anyway, a different strategy is used to find the end
' of the file name...
' 06Jan04: save to DESKTOP (instead of wintemp), for easier access...
' --- end of description block -------------------

Option Explicit

' instantiate ActX components here...
Dim xmlHTTP : Set xmlHTTP = CreateObject("Microsoft.XMLHTTP")
Dim adoStream : Set adoStream = CreateObject("adodb.stream")
Dim wshShell : Set wshShell = CreateObject("WScript.Shell")
Dim wshSysEnv : Set wshSysEnv = wshShell.Environment("PROCESS")
' --- end of instantiations ----------------------
'
' --- Module Level Variables and Constants -------
Const sSource = "http://www.dilbert.com"
Dim sImgTag : sImgTag = "<IMG SRC=""/comics/dilbert/archive/images/dilbert"
' save the dilbert graphic here (was win/temp, now win/desktop)...
' Dim sSavePath : sSavePath = wshSysEnv("TEMP") & "\"
Dim sSavePath : sSavePath = wshShell.SpecialFolders("Desktop") & "\"
Dim iDayOfWeek : iDayOfWeek = Weekday(Date)
Dim sGraphicType : sGraphicType = ".gif" ' weekdays a gif?
if (iDayOfWeek = vbSunday) then sGraphicType = ".jpg"
Dim sSaveName : sSaveName = "TodaysDilbert_" & DateAs_ddMMMyy(Date) & sGraphicType
'
Dim sHTMLPage ' as string (dilbert page as text)
Dim iImgTag ' as long (location of image tag within page)
Dim iImgExt ' as long (location of the file extension)
Dim iSrcStart, iSrcLength ' as long(s), temp vars for extracting imgtag
Dim sImageSource ' as string (location of the graphic)
'
Const bGetAsAsync = False ' wait for response
'
Const adTypeBinary = 1 ' ado typelib constants
Const adModeReadWrite = 3
Const adSaveCreateOverwrite = 2
'
Dim nAns ' as integer
' --- end of declarations and constants ----------


' ================================================
' === MAIN LINE SCRIPT LOGIC HERE ================
' ================================================

' MsgBox("Source URL: " & sSource & vbNewLine _
' & "Save File Dest: " & sSavePath & sSaveName)

' --- discussion -------------------------------
' Getting the Dilbert-of-the-day comic strip, is a "two-step"
' process. First we are downloading the dilbert website
' opening page. Then we search through the page to get the
' image tag for the strip. Then we download the strip.
' Note: the page is retrieved as TEXT, the graphics are
' retrieved as BINARY data...
' --- end of discussion ------------------------

' formulate a request to get the Dilbert website...
xmlHTTP.Open "GET", sSource, bGetAsAsync
xmlHTTP.Send ' send it (to the web, wait for result)

sHTMLPage = xmlHTTP.responseText ' (note: as TEXT)

' --- grumble, grumble, grumble ----------------
' The dilbert page does not seem to be set up for the convenience
' of graphics rippers, i.e., there is no handy "id" for locating
' the url for the graphics. And so, we are using a "brute force"
' method -- searching through the html text for something that
' resembles what we want...
' --- end of grumbling -------------------------

' locate the strip graphic image tag...
iImgTag = Instr(sHTMLPage, sImgTag)
' MsgBox("found imgtag string at: " & CStr(iImgTag))

' get the location of the image source file...
iSrcStart = iImgTag + 10
' uh-oh. Apparently the number of characters in the image name
' is VARIABLE (ugh!), perhaps in order to "throw off" rippers(?).
' So here, make an attempt to find the end of the string,
' by using the (expected) filetype...
iImgExt = Instr(iImgTag, sHTMLPage, sGraphicType)
' MsgBox("found ext at: " & CStr(iImgExt))
iSrcLength = iImgExt - iSrcStart + 4 ' 13 = date field, 4 = ".jpg/.gif"

' extract the location of the image source file...
sImageSource = Mid(sHTMLPage, iSrcStart, iSrcLength)

' addin the "base" url, to form graphics url...
sImageSource = sSource & sImageSource
' MsgBox(sImageSource)
' ----------------------------------------------

' xmlHTTP.onreadystatechange = GetRef("xmlHTTP_ReadyStateChange")

' formulate a request to get the image (i.e., the cartoon strip)...
xmlHTTP.Open "GET", sImageSource, bGetAsAsync
xmlHTTP.Send ' send it (to the web, wait for result)
' MsgBox("Got It!")


With adoStream ' setup and write the graphics file to local disk...
.Type = adTypeBinary ' as BINARY
.Mode = adModeReadWrite
.Open ' the stream
.Write xmlHTTP.responseBody ' write the data (as binary)...
.SaveToFile sSavePath & sSaveName, adSaveCreateOverwrite
.Close ' the stream
End With

' tell user the file was saved...
nAns = MsgBox("Today's Dilbert Strip saved as: " & sSavePath & sSaveName _
& vbCrLf & vbCrLf & " would you like to view it now???", _
vbInformation Or vbYesNo, " < wsh Dilbert Ripper Script > ")

' show the current dilbert cartoon strip now (if desired),
' note: "running" the file will hopefully open it in its
' default opener app, as described in the ms scripting doc: (quote)
' "If a file type has been properly registered to a particular program,
' calling run on a file of that type executes the program. For example,
' if Word is installed on your computer system, calling Run on a *.doc
' file starts Word and loads the document".
' (At least on my system, InternetExplorer is the opener for a "jpg" file).
if (nAns = vbYes) then wshShell.Run sSavePath & sSaveName


Set wshSysEnv = nothing ' clean up
Set wshShell = nothing
set xmlHTTP = nothing
set adoStream = nothing

WScript.Quit


' ================================================
' === SUBROUTINES FOLLOW =========================
' ================================================

Sub xmlHTTP_ReadyStateChange() ' event handler
MsgBox("readystate: " & CStr(xmlHTTP.ReadyState))
End Sub



Function DateAs_ddMMMyy(vDate) ' returns a date in "Military Format"...
Dim sDD, sMMM, sYY ' as string(s)

' get the day (as two digits)
sDD = Right("0" & CStr(Day(vDate)), 2)
sMMM = MonthName(Month(vDate), True) ' abbreviated month
sYY = Right(CStr(Year(vDate)), 2)

DateAs_ddMMMyy = sDD & sMMM & sYY ' set result, return
End Function


' --- A Place to stash old code, not quite ready for bit-bucket ---

Sub Old_Code()

End Sub



--------------010502000504010601040709--

Re: Any Help to get me started would be appreciated..... by dave

dave
Sun May 14 20:16:46 CDT 2006

JW;
Thanks for this. I think ripping dilbert is harder than what I have so
maybe this will help a little. You see the site I'm working from is
part of a subsciber service that requires a password, etc so giving you
the specific URL's is not going to help since I can get you to the
site. I will however describe the steps I have to go through. If I
can use a txt file to read the stock symbol (that's what it is not
reciepes) then the data that I would normally get will be saved as a
txt file for that symbol. Then the program would sequence to the next
symbol, retrieve the data and save it as a txt file with the stock
symbol as the file name. So here is the sequence I have to manually
complete.....

1. I am logged in to the site at the following URL
"http://www.betterinvesting.org/".
2. A text box allows me to enter a stock symbol (say stock xyz) and
once I enter it I click on the "Go" command button.
3. This this takes me to the following
"http://www.betterinvesting.org/stocks/tools/report.html?ticker=xyz&x=12&y=8".
You will note the xyz ticker symbol imbedded into the URL. That ticker
symbol is what I want to pull from my ticker symbol txt file which may
have 20 or 30 symbols in it.
4. This page allows me to select from a variety of commands/links (Get
data, Print, etc) for this particular stock symbol. The one I use is a
link called "Get Data"
5. Once I select this a Windows File Download window appears and shows
the file name I will be getting and the url it will find it at. In
this case the URL happens to be
"http://www.betterinvesting.org/ssg/XYZ". The file name in the
download window is XYZ.ssg.
6. I select "Save" (not open) from the download window which opens a
"Save As" Window form where I select the folder to save it in. Let's
use C:\mydocs\Stock Symbols\ as the location.
7. Once it's saved I am back at step #1 where i then enter another
symbol. This is where I'd like it to read the next symbol from a txt
file of symbols and use parsing and string manipulation to create the
proper URL the next steps.

So, what do you think? Is this doable? It seems easier than the code
you already supplied although I'm not sure. If you can supply me with
a start on this I'm sure I could trial and error my way through it. If
it's too much work then I understand and still appreciate the time you
spent with me on this little task.

Thanks
Dave


Re: Any Help to get me started would be appreciated..... by dave

dave
Mon May 22 16:54:22 CDT 2006

Is there anyone that can help me with my last post?

thxs
dave


Re: Any Help to get me started would be appreciated..... by Anthony

Anthony
Tue May 23 02:29:50 CDT 2006


"dave" <markie@htva.net> wrote in message
news:1147655806.532865.187630@i39g2000cwa.googlegroups.com...
> JW;
> Thanks for this. I think ripping dilbert is harder than what I have so
> maybe this will help a little. You see the site I'm working from is
> part of a subsciber service that requires a password, etc so giving you
> the specific URL's is not going to help since I can get you to the
> site. I will however describe the steps I have to go through. If I
> can use a txt file to read the stock symbol (that's what it is not
> reciepes) then the data that I would normally get will be saved as a
> txt file for that symbol. Then the program would sequence to the next
> symbol, retrieve the data and save it as a txt file with the stock
> symbol as the file name. So here is the sequence I have to manually
> complete.....
>
> 1. I am logged in to the site at the following URL
> "http://www.betterinvesting.org/".

The above is the main problem. The rest is a piece of cake. E.g:-


Option Explicit

Dim oXMLHTTP
Dim oStream

Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP.3.0")

oXMLHTTP.Open "GET", "http://www.betterinvesting.org/ssg/XYZ/". ", False
oXMLHTTP.Send

If oXMLHTTP.Status = 200 Then
Set oStream = CreateObject("ADODB.Stream")
oStream.Open
oStream.Type = 1
oStream.Write oXMLHTTP.responseBody
oStream.SaveToFile "g:\temp\xyz.ssg"
oStream.Close
End If


However this is going to give you the forbidden response. You will need to
spoof the cookies, headers or whatever else the site uses for security. I
would hope that this is impossible but I guess it's probably only very
difficult.




> 2. A text box allows me to enter a stock symbol (say stock xyz) and
> once I enter it I click on the "Go" command button.
> 3. This this takes me to the following
>
"http://www.betterinvesting.org/stocks/tools/report.html?ticker=xyz&x=12&y=8
".
> You will note the xyz ticker symbol imbedded into the URL. That ticker
> symbol is what I want to pull from my ticker symbol txt file which may
> have 20 or 30 symbols in it.
> 4. This page allows me to select from a variety of commands/links (Get
> data, Print, etc) for this particular stock symbol. The one I use is a
> link called "Get Data"
> 5. Once I select this a Windows File Download window appears and shows
> the file name I will be getting and the url it will find it at. In
> this case the URL happens to be
> "http://www.betterinvesting.org/ssg/XYZ". The file name in the
> download window is XYZ.ssg.
> 6. I select "Save" (not open) from the download window which opens a
> "Save As" Window form where I select the folder to save it in. Let's
> use C:\mydocs\Stock Symbols\ as the location.
> 7. Once it's saved I am back at step #1 where i then enter another
> symbol. This is where I'd like it to read the next symbol from a txt
> file of symbols and use parsing and string manipulation to create the
> proper URL the next steps.
>
> So, what do you think? Is this doable? It seems easier than the code
> you already supplied although I'm not sure. If you can supply me with
> a start on this I'm sure I could trial and error my way through it. If
> it's too much work then I understand and still appreciate the time you
> spent with me on this little task.
>
> Thanks
> Dave
>



Re: Any Help to get me started would be appreciated..... by dave

dave
Fri Jun 02 06:06:39 CDT 2006

Thanks anthony. I can understand this forbiden response if it was
someone besides me running this script from another PC but can this not
work if I run this on my PC? as whenever I go to the site it already
recognizes me and gives me access to the site without having to log in
again. It seems to remeber me (cookies?) from my previous access. Now
if I'm on the site and I select "log out" I will have to log in next
time I come to the site.

Can I not run a script given this situation without being blocked out?

Anthony Jones wrote:
> "dave" <markie@htva.net> wrote in message
> news:1147655806.532865.187630@i39g2000cwa.googlegroups.com...
> > JW;
> > Thanks for this. I think ripping dilbert is harder than what I have so
> > maybe this will help a little. You see the site I'm working from is
> > part of a subsciber service that requires a password, etc so giving you
> > the specific URL's is not going to help since I can get you to the
> > site. I will however describe the steps I have to go through. If I
> > can use a txt file to read the stock symbol (that's what it is not
> > reciepes) then the data that I would normally get will be saved as a
> > txt file for that symbol. Then the program would sequence to the next
> > symbol, retrieve the data and save it as a txt file with the stock
> > symbol as the file name. So here is the sequence I have to manually
> > complete.....
> >
> > 1. I am logged in to the site at the following URL
> > "http://www.betterinvesting.org/".
>
> The above is the main problem. The rest is a piece of cake. E.g:-
>
>
> Option Explicit
>
> Dim oXMLHTTP
> Dim oStream
>
> Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP.3.0")
>
> oXMLHTTP.Open "GET", "http://www.betterinvesting.org/ssg/XYZ/". ", False
> oXMLHTTP.Send
>
> If oXMLHTTP.Status = 200 Then
> Set oStream = CreateObject("ADODB.Stream")
> oStream.Open
> oStream.Type = 1
> oStream.Write oXMLHTTP.responseBody
> oStream.SaveToFile "g:\temp\xyz.ssg"
> oStream.Close
> End If
>
>
> However this is going to give you the forbidden response. You will need to
> spoof the cookies, headers or whatever else the site uses for security. I
> would hope that this is impossible but I guess it's probably only very
> difficult.
>
>
>
>
> > 2. A text box allows me to enter a stock symbol (say stock xyz) and
> > once I enter it I click on the "Go" command button.
> > 3. This this takes me to the following
> >
> "http://www.betterinvesting.org/stocks/tools/report.html?ticker=xyz&x=12&y=8
> ".
> > You will note the xyz ticker symbol imbedded into the URL. That ticker
> > symbol is what I want to pull from my ticker symbol txt file which may
> > have 20 or 30 symbols in it.
> > 4. This page allows me to select from a variety of commands/links (Get
> > data, Print, etc) for this particular stock symbol. The one I use is a
> > link called "Get Data"
> > 5. Once I select this a Windows File Download window appears and shows
> > the file name I will be getting and the url it will find it at. In
> > this case the URL happens to be
> > "http://www.betterinvesting.org/ssg/XYZ". The file name in the
> > download window is XYZ.ssg.
> > 6. I select "Save" (not open) from the download window which opens a
> > "Save As" Window form where I select the folder to save it in. Let's
> > use C:\mydocs\Stock Symbols\ as the location.
> > 7. Once it's saved I am back at step #1 where i then enter another
> > symbol. This is where I'd like it to read the next symbol from a txt
> > file of symbols and use parsing and string manipulation to create the
> > proper URL the next steps.
> >
> > So, what do you think? Is this doable? It seems easier than the code
> > you already supplied although I'm not sure. If you can supply me with
> > a start on this I'm sure I could trial and error my way through it. If
> > it's too much work then I understand and still appreciate the time you
> > spent with me on this little task.
> >
> > Thanks
> > Dave
> >


Re: Any Help to get me started would be appreciated..... by Anthony

Anthony
Fri Jun 02 07:58:03 CDT 2006


"dave" <markie@htva.net> wrote in message
news:1149246399.369191.74600@u72g2000cwu.googlegroups.com...
> Thanks anthony. I can understand this forbiden response if it was
> someone besides me running this script from another PC but can this not
> work if I run this on my PC? as whenever I go to the site it already
> recognizes me and gives me access to the site without having to log in
> again. It seems to remeber me (cookies?) from my previous access. Now
> if I'm on the site and I select "log out" I will have to log in next
> time I come to the site.
>
> Can I not run a script given this situation without being blocked out?

It's difficult to diagnose without understanding how the site achieves it's
logon security.

The login you describe could be acheived by couple of different mechanisms
OFTOMH.

First though can I confirm that you can visit the site, logon then close all
browsers windows.
Then return to the site and find yourself still logged on? That would be an
unusual scenario.

I suspect that what you will find is that you can navigate away from the
site and return to it still logged in to it because it'll be using a session
cookie. However a VBS script will run it's own process and not be able to
make use of the session cookie (since they are limited in scope to the
process that received them).

Anthony.



>
> Anthony Jones wrote:
> > "dave" <markie@htva.net> wrote in message
> > news:1147655806.532865.187630@i39g2000cwa.googlegroups.com...
> > > JW;
> > > Thanks for this. I think ripping dilbert is harder than what I have
so
> > > maybe this will help a little. You see the site I'm working from is
> > > part of a subsciber service that requires a password, etc so giving
you
> > > the specific URL's is not going to help since I can get you to the
> > > site. I will however describe the steps I have to go through. If I
> > > can use a txt file to read the stock symbol (that's what it is not
> > > reciepes) then the data that I would normally get will be saved as a
> > > txt file for that symbol. Then the program would sequence to the next
> > > symbol, retrieve the data and save it as a txt file with the stock
> > > symbol as the file name. So here is the sequence I have to manually
> > > complete.....
> > >
> > > 1. I am logged in to the site at the following URL
> > > "http://www.betterinvesting.org/".
> >
> > The above is the main problem. The rest is a piece of cake. E.g:-
> >
> >
> > Option Explicit
> >
> > Dim oXMLHTTP
> > Dim oStream
> >
> > Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP.3.0")
> >
> > oXMLHTTP.Open "GET", "http://www.betterinvesting.org/ssg/XYZ/". ",
False
> > oXMLHTTP.Send
> >
> > If oXMLHTTP.Status = 200 Then
> > Set oStream = CreateObject("ADODB.Stream")
> > oStream.Open
> > oStream.Type = 1
> > oStream.Write oXMLHTTP.responseBody
> > oStream.SaveToFile "g:\temp\xyz.ssg"
> > oStream.Close
> > End If
> >
> >
> > However this is going to give you the forbidden response. You will need
to
> > spoof the cookies, headers or whatever else the site uses for security.
I
> > would hope that this is impossible but I guess it's probably only very
> > difficult.
> >
> >
> >
> >
> > > 2. A text box allows me to enter a stock symbol (say stock xyz) and
> > > once I enter it I click on the "Go" command button.
> > > 3. This this takes me to the following
> > >
> >
"http://www.betterinvesting.org/stocks/tools/report.html?ticker=xyz&x=12&y=8
> > ".
> > > You will note the xyz ticker symbol imbedded into the URL. That ticker
> > > symbol is what I want to pull from my ticker symbol txt file which may
> > > have 20 or 30 symbols in it.
> > > 4. This page allows me to select from a variety of commands/links
(Get
> > > data, Print, etc) for this particular stock symbol. The one I use is
a
> > > link called "Get Data"
> > > 5. Once I select this a Windows File Download window appears and shows
> > > the file name I will be getting and the url it will find it at. In
> > > this case the URL happens to be
> > > "http://www.betterinvesting.org/ssg/XYZ". The file name in the
> > > download window is XYZ.ssg.
> > > 6. I select "Save" (not open) from the download window which opens a
> > > "Save As" Window form where I select the folder to save it in. Let's
> > > use C:\mydocs\Stock Symbols\ as the location.
> > > 7. Once it's saved I am back at step #1 where i then enter another
> > > symbol. This is where I'd like it to read the next symbol from a txt
> > > file of symbols and use parsing and string manipulation to create the
> > > proper URL the next steps.
> > >
> > > So, what do you think? Is this doable? It seems easier than the code
> > > you already supplied although I'm not sure. If you can supply me with
> > > a start on this I'm sure I could trial and error my way through it.
If
> > > it's too much work then I understand and still appreciate the time you
> > > spent with me on this little task.
> > >
> > > Thanks
> > > Dave
> > >
>



Re: Any Help to get me started would be appreciated..... by dave

dave
Sat Jun 03 14:29:55 CDT 2006

Anthony;
I went to the site and was not logged in as it will have a note at the
top "Welcome Dave M....." so I log on with my user name and password
and checked the box "Remeber my Logon". Then I closed all browsers
(IE), waited a few mintues then went to my favorites and selected the
site (http://www.betterinvesting.org/). When it came up I was already
logged in with my Welcome message and name in the page. I then closed
the broswer and restarted my PC. When booted up I went back to the
site and was still logged in. By the way when I am logged in the page
does allow you to "log out" by clicking on that selection which I do
not select. Instead I just close the browser.

Based on this is their a way I can get a srcipt to run that I describe
in the earlier posts and not need a log in sequence?

thanks for your time and help
Dave

Anthony Jones wrote:
> "dave" <markie@htva.net> wrote in message
> news:1149246399.369191.74600@u72g2000cwu.googlegroups.com...
> > Thanks anthony. I can understand this forbiden response if it was
> > someone besides me running this script from another PC but can this not
> > work if I run this on my PC? as whenever I go to the site it already
> > recognizes me and gives me access to the site without having to log in
> > again. It seems to remeber me (cookies?) from my previous access. Now
> > if I'm on the site and I select "log out" I will have to log in next
> > time I come to the site.
> >
> > Can I not run a script given this situation without being blocked out?
>
> It's difficult to diagnose without understanding how the site achieves it's
> logon security.
>
> The login you describe could be acheived by couple of different mechanisms
> OFTOMH.
>
> First though can I confirm that you can visit the site, logon then close all
> browsers windows.
> Then return to the site and find yourself still logged on? That would be an
> unusual scenario.
>
> I suspect that what you will find is that you can navigate away from the
> site and return to it still logged in to it because it'll be using a session
> cookie. However a VBS script will run it's own process and not be able to
> make use of the session cookie (since they are limited in scope to the
> process that received them).
>
> Anthony.
>
>
>
> >
> > Anthony Jones wrote:
> > > "dave" <markie@htva.net> wrote in message
> > > news:1147655806.532865.187630@i39g2000cwa.googlegroups.com...
> > > > JW;
> > > > Thanks for this. I think ripping dilbert is harder than what I have
> so
> > > > maybe this will help a little. You see the site I'm working from is
> > > > part of a subsciber service that requires a password, etc so giving
> you
> > > > the specific URL's is not going to help since I can get you to the
> > > > site. I will however describe the steps I have to go through. If I
> > > > can use a txt file to read the stock symbol (that's what it is not
> > > > reciepes) then the data that I would normally get will be saved as a
> > > > txt file for that symbol. Then the program would sequence to the next
> > > > symbol, retrieve the data and save it as a txt file with the stock
> > > > symbol as the file name. So here is the sequence I have to manually
> > > > complete.....
> > > >
> > > > 1. I am logged in to the site at the following URL
> > > > "http://www.betterinvesting.org/".
> > >
> > > The above is the main problem. The rest is a piece of cake. E.g:-
> > >
> > >
> > > Option Explicit
> > >
> > > Dim oXMLHTTP
> > > Dim oStream
> > >
> > > Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP.3.0")
> > >
> > > oXMLHTTP.Open "GET", "http://www.betterinvesting.org/ssg/XYZ/". ",
> False
> > > oXMLHTTP.Send
> > >
> > > If oXMLHTTP.Status = 200 Then
> > > Set oStream = CreateObject("ADODB.Stream")
> > > oStream.Open
> > > oStream.Type = 1
> > > oStream.Write oXMLHTTP.responseBody
> > > oStream.SaveToFile "g:\temp\xyz.ssg"
> > > oStream.Close
> > > End If
> > >
> > >
> > > However this is going to give you the forbidden response. You will need
> to
> > > spoof the cookies, headers or whatever else the site uses for security.
> I
> > > would hope that this is impossible but I guess it's probably only very
> > > difficult.
> > >
> > >
> > >
> > >
> > > > 2. A text box allows me to enter a stock symbol (say stock xyz) and
> > > > once I enter it I click on the "Go" command button.
> > > > 3. This this takes me to the following
> > > >
> > >
> "http://www.betterinvesting.org/stocks/tools/report.html?ticker=xyz&x=12&y=8
> > > ".
> > > > You will note the xyz ticker symbol imbedded into the URL. That ticker
> > > > symbol is what I want to pull from my ticker symbol txt file which may
> > > > have 20 or 30 symbols in it.
> > > > 4. This page allows me to select from a variety of commands/links
> (Get
> > > > data, Print, etc) for this particular stock symbol. The one I use is
> a
> > > > link called "Get Data"
> > > > 5. Once I select this a Windows File Download window appears and shows
> > > > the file name I will be getting and the url it will find it at. In
> > > > this case the URL happens to be
> > > > "http://www.betterinvesting.org/ssg/XYZ". The file name in the
> > > > download window is XYZ.ssg.
> > > > 6. I select "Save" (not open) from the download window which opens a
> > > > "Save As" Window form where I select the folder to save it in. Let's
> > > > use C:\mydocs\Stock Symbols\ as the location.
> > > > 7. Once it's saved I am back at step #1 where i then enter another
> > > > symbol. This is where I'd like it to read the next symbol from a txt
> > > > file of symbols and use parsing and string manipulation to create the
> > > > proper URL the next steps.
> > > >
> > > > So, what do you think? Is this doable? It seems easier than the code
> > > > you already supplied although I'm not sure. If you can supply me with
> > > > a start on this I'm sure I could trial and error my way through it.
> If
> > > > it's too much work then I understand and still appreciate the time you
> > > > spent with me on this little task.
> > > >
> > > > Thanks
> > > > Dave
> > > >
> >


Re: Any Help to get me started would be appreciated..... by dave

dave
Fri Jun 09 05:49:51 CDT 2006

Anthony;
Any thoughts on the information I posted in my last response? As you
mentioned maybe the what I'm trying to accomplish is not do able, it
just seem rather straight forward other than the site requiring a login
issue.

Dave

dave wrote:
> Anthony;
> I went to the site and was not logged in as it will have a note at the
> top "Welcome Dave M....." so I log on with my user name and password
> and checked the box "Remeber my Logon". Then I closed all browsers
> (IE), waited a few mintues then went to my favorites and selected the
> site (http://www.betterinvesting.org/). When it came up I was already
> logged in with my Welcome message and name in the page. I then closed
> the broswer and restarted my PC. When booted up I went back to the
> site and was still logged in. By the way when I am logged in the page
> does allow you to "log out" by clicking on that selection which I do
> not select. Instead I just close the browser.
>
> Based on this is their a way I can get a srcipt to run that I describe
> in the earlier posts and not need a log in sequence?
>
> thanks for your time and help
> Dave
>
> Anthony Jones wrote:
> > "dave" <markie@htva.net> wrote in message
> > news:1149246399.369191.74600@u72g2000cwu.googlegroups.com...
> > > Thanks anthony. I can understand this forbiden response if it was
> > > someone besides me running this script from another PC but can this not
> > > work if I run this on my PC? as whenever I go to the site it already
> > > recognizes me and gives me access to the site without having to log in
> > > again. It seems to remeber me (cookies?) from my previous access. Now
> > > if I'm on the site and I select "log out" I will have to log in next
> > > time I come to the site.
> > >
> > > Can I not run a script given this situation without being blocked out?
> >
> > It's difficult to diagnose without understanding how the site achieves it's
> > logon security.
> >
> > The login you describe could be acheived by couple of different mechanisms
> > OFTOMH.
> >
> > First though can I confirm that you can visit the site, logon then close all
> > browsers windows.
> > Then return to the site and find yourself still logged on? That would be an
> > unusual scenario.
> >
> > I suspect that what you will find is that you can navigate away from the
> > site and return to it still logged in to it because it'll be using a session
> > cookie. However a VBS script will run it's own process and not be able to
> > make use of the session cookie (since they are limited in scope to the
> > process that received them).
> >
> > Anthony.
> >
> >
> >
> > >
> > > Anthony Jones wrote:
> > > > "dave" <markie@htva.net> wrote in message
> > > > news:1147655806.532865.187630@i39g2000cwa.googlegroups.com...
> > > > > JW;
> > > > > Thanks for this. I think ripping dilbert is harder than what I have
> > so
> > > > > maybe this will help a little. You see the site I'm working from is
> > > > > part of a subsciber service that requires a password, etc so giving
> > you
> > > > > the specific URL's is not going to help since I can get you to the
> > > > > site. I will however describe the steps I have to go through. If I
> > > > > can use a txt file to read the stock symbol (that's what it is not
> > > > > reciepes) then the data that I would normally get will be saved as a
> > > > > txt file for that symbol. Then the program would sequence to the next
> > > > > symbol, retrieve the data and save it as a txt file with the stock
> > > > > symbol as the file name. So here is the sequence I have to manually
> > > > > complete.....
> > > > >
> > > > > 1. I am logged in to the site at the following URL
> > > > > "http://www.betterinvesting.org/".
> > > >
> > > > The above is the main problem. The rest is a piece of cake. E.g:-
> > > >
> > > >
> > > > Option Explicit
> > > >
> > > > Dim oXMLHTTP
> > > > Dim oStream
> > > >
> > > > Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP.3.0")
> > > >
> > > > oXMLHTTP.Open "GET", "http://www.betterinvesting.org/ssg/XYZ/". ",
> > False
> > > > oXMLHTTP.Send
> > > >
> > > > If oXMLHTTP.Status = 200 Then
> > > > Set oStream = CreateObject("ADODB.Stream")
> > > > oStream.Open
> > > > oStream.Type = 1
> > > > oStream.Write oXMLHTTP.responseBody
> > > > oStream.SaveToFile "g:\temp\xyz.ssg"
> > > > oStream.Close
> > > > End If
> > > >
> > > >
> > > > However this is going to give you the forbidden response. You will need
> > to
> > > > spoof the cookies, headers or whatever else the site uses for security.
> > I
> > > > would hope that this is impossible but I guess it's probably only very
> > > > difficult.
> > > >
> > > >
> > > >
> > > >
> > > > > 2. A text box allows me to enter a stock symbol (say stock xyz) and
> > > > > once I enter it I click on the "Go" command button.
> > > > > 3. This this takes me to the following
> > > > >
> > > >
> > "http://www.betterinvesting.org/stocks/tools/report.html?ticker=xyz&x=12&y=8
> > > > ".
> > > > > You will note the xyz ticker symbol imbedded into the URL. That ticker
> > > > > symbol is what I want to pull from my ticker symbol txt file which may
> > > > > have 20 or 30 symbols in it.
> > > > > 4. This page allows me to select from a variety of commands/links
> > (Get
> > > > > data, Print, etc) for this particular stock symbol. The one I use is
> > a
> > > > > link called "Get Data"
> > > > > 5. Once I select this a Windows File Download window appears and shows
> > > > > the file name I will be getting and the url it will find it at. In
> > > > > this case the URL happens to be
> > > > > "http://www.betterinvesting.org/ssg/XYZ". The file name in the
> > > > > download window is XYZ.ssg.
> > > > > 6. I select "Save" (not open) from the download window which opens a
> > > > > "Save As" Window form where I select the folder to save it in. Let's
> > > > > use C:\mydocs\Stock Symbols\ as the location.
> > > > > 7. Once it's saved I am back at step #1 where i then enter another
> > > > > symbol. This is where I'd like it to read the next symbol from a txt
> > > > > file of symbols and use parsing and string manipulation to create the
> > > > > proper URL the next steps.
> > > > >
> > > > > So, what do you think? Is this doable? It seems easier than the code
> > > > > you already supplied although I'm not sure. If you can supply me with
> > > > > a start on this I'm sure I could trial and error my way through it.
> > If
> > > > > it's too much work then I understand and still appreciate the time you
> > > > > spent with me on this little task.
> > > > >
> > > > > Thanks
> > > > > Dave
> > > > >
> > >