Announcement
Collapse
No announcement yet.
Help with scritp error...
Collapse
X
-
Just had a closer look at the page is returing a 404 error page not found.
Your page_name is returning 091 and needs to be 0901
Update $$$$$$$$$$$$$$$$$$$$$$$$$$$
Here's the working script:
Code:Sub main() Dim d Dim m Dim dy Dim page Dim page_name Dim length_paragraph Dim month_name d = Date m = Month(d) dy = Day(d) if dy < 10 then dy = 0 & dy end if month_name = MonthName(m) If m < 10 Then m = 0 & m End If hs.speak "This day in history!",True page_name = m & dy & ".html" page = hs.GetURL("http://features.yahoo.com/history/","/" & page_name,True,80) beginning = InStr (page, month_name) the_end= InStr (page, "Find out what else happened") length_paragraph = the_end - beginning Text= "" & Mid (page, beginning,length_paragraph) & "" hs.speak Text,True End Sub
Last edited by Rupp; September 1, 2005, 09:19 PM.
Leave a comment:
-
Try putting a msgbox(page) after the second page reference and maybe a msgbox(beginning) etc to make sure the scrape is still finding what you expect. The error is probably caused by missing data.
Leave a comment:
-
Help with scritp error...
I normally can fix these small errors, but this one seems easy and yet I can't seem to correct it... The following is the statement in error, followed by the full script the statement is included in... This worked up until the latest version of HS2... If you can provide help, I really appreciate it!!!
Statement in error:
Text= "<ATT_IGNORE_CASE>" & Mid (page, beginning,length_paragraph) & "</ATT_IGNORE_CASE>"
Complete Script:
Sub main()
Dim d
Dim m
Dim dy
Dim page
Dim page_name
Dim length_paragraph
Dim month_name
d = Date
m = Month(d)
dy = Day(d)
month_name = MonthName(m)
If m < 10 Then
m = 0 & m
End If
hs.speak "This day in history!",True
page_name = m & dy & ".html"
page = hs.GetURL("http://features.yahoo.com/history/","/" & page_name,True,80)
beginning = InStr (page, month_name)
the_end= InStr (page, "Find out what else happened")
length_paragraph = the_end - beginning
Text= "<ATT_IGNORE_CASE>" & Mid (page, beginning,length_paragraph) & "</ATT_IGNORE_CASE>"
hs.speak Text,True
End SubTags: None
Leave a comment: