By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,663 Members | 1,398 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,663 IT Pros & Developers. It's quick & easy.

how to grab content from another site

P: n/a
Hi!

I'm stuck on a little problem...

I want to get te article heading-text and teaser from
http://www.avisa-valdres.no and display it on another page using asp code...

An example on this: www.valdres.no is picking news from www.avisa-valdres.no
and displaying it on valdres.no...

How can I do this with ASP/VBScript code??
Any idea?

The code on valdres.no wich pics the content is made in iHTML, so that does
not help me much ;)

regards
Christopher Brandsdal
Norway
Jul 19 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
http://aspfaq.com/show.asp?id=2173

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
"Christopher Brandsdal" <br*******@binaer.no> wrote in message
news:u2**************@TK2MSFTNGP12.phx.gbl...
Hi!

I'm stuck on a little problem...

I want to get te article heading-text and teaser from
http://www.avisa-valdres.no and display it on another page using asp code...
An example on this: www.valdres.no is picking news from www.avisa-valdres.no and displaying it on valdres.no...

How can I do this with ASP/VBScript code??
Any idea?

The code on valdres.no wich pics the content is made in iHTML, so that does not help me much ;)

regards
Christopher Brandsdal
Norway

Jul 19 '05 #2

P: n/a
Thanks!

But there is only one more problem...
When I grab a site containing the norwegian characters זרו, it does not
understand the characters. Is there any way I can get it to understand זרו?
"Steven Burn" <pv*@noyb.com> wrote in message
news:uv**************@tk2msftngp13.phx.gbl...
http://aspfaq.com/show.asp?id=2173

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
"Christopher Brandsdal" <br*******@binaer.no> wrote in message
news:u2**************@TK2MSFTNGP12.phx.gbl...
Hi!

I'm stuck on a little problem...

I want to get te article heading-text and teaser from
http://www.avisa-valdres.no and display it on another page using asp

code...

An example on this: www.valdres.no is picking news from

www.avisa-valdres.no
and displaying it on valdres.no...

How can I do this with ASP/VBScript code??
Any idea?

The code on valdres.no wich pics the content is made in iHTML, so that

does
not help me much ;)

regards
Christopher Brandsdal
Norway


Jul 19 '05 #3

P: n/a
Christopher Brandsdal wrote on 13 jul 2004 in
microsoft.public.inetserver.asp.general:
When I grab a site containing the norwegian characters זרו, it does
not understand the characters. Is there any way I can get it to
understand זרו?


I do not understand "understand", since a programme is not understanding
anything.

Perhaps:

s = "זר"

s = replace(s,"ז","ae")
s = replace(s,"ר","[slashed o]") ' or whatever

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #4

P: n/a
http://forums.devarticles.com/archive/t-3992

see this link to understand what I mean....

"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
Christopher Brandsdal wrote on 13 jul 2004 in
microsoft.public.inetserver.asp.general:
When I grab a site containing the norwegian characters זרו, it does
not understand the characters. Is there any way I can get it to
understand זרו?


I do not understand "understand", since a programme is not understanding
anything.

Perhaps:

s = "זר"

s = replace(s,"ז","ae")
s = replace(s,"ר","[slashed o]") ' or whatever

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Jul 19 '05 #5

P: n/a
found the solution myself :)

<%
'function for reading "non-english" charachters
Function BinToText(varBinData, intDataSizeInBytes)
Dim objRS
Const adFldLong = &H00000080
Const adVarChar = 200
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Fields.Append "txt", adVarChar, intDataSizeInBytes, adFldLong
objRS.Open
objRS.AddNew
objRS.Fields("txt").AppendChunk varBinData
BinToText = objRS("txt").Value
objRS.Close
Set objRS = Nothing
End Function

Function GetHTML(strURL,strStart,strEnd)
Dim objXMLHTTP, strReturn, strHTML
Set objXMLHTTP = Server.CreateObject("Msxml2.ServerXMLHTTP")
objXMLHTTP.Open "GET", strURL, False
objXMLHTTP.SetRequestHeader "content-type","text/html;charset=ISO-8859-1"
objXMLHTTP.Send
strHTML = BinToText(objXMLHTTP.responseBody, 4800)
Set objXMLHTTP = Nothing

Dim st,en
st=Instr(strHTML,strStart)
If st<>0 Then
st=st+Len(strStart)
en=Instr(st,strHTML,strEnd)
strReturn=Mid(strHTML, st, en-st)
Else
strReturn="Ingen driftsmeldinger tilgjengelig."
End If
GetHTML = strReturn
End Function

'*****************----- MY CONFIG SECTION START -----*****************
dim URLsnatch, HTMLsBlock, HTMLeBlock
'Webpage to scrape
URLsnatch = "http://www.avisa-valdres.no/default.asp"
'Where to start scraping the webpage
HTMLsBlock = "<! Hovedkolonne ->"
'Where to end scraping the webpage
HTMLeBlock = "<! Vertikal skille 2 ->"
'******************----- MY CONFIG SECTION END -----******************
'Write it:
Dim grabbedText
grabbedText = GetHTML(URLsnatch,HTMLsBlock,HTMLeBlock)
%>

<%=grabbedtext%>
"Christopher Brandsdal" <br*******@binaer.no> wrote in message
news:#B**************@TK2MSFTNGP11.phx.gbl...
http://forums.devarticles.com/archive/t-3992

see this link to understand what I mean....

"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
Christopher Brandsdal wrote on 13 jul 2004 in
microsoft.public.inetserver.asp.general:
When I grab a site containing the norwegian characters זרו, it does
not understand the characters. Is there any way I can get it to
understand זרו?


I do not understand "understand", since a programme is not understanding
anything.

Perhaps:

s = "זר"

s = replace(s,"ז","ae")
s = replace(s,"ר","[slashed o]") ' or whatever

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)


Jul 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.