472,373 Members | 2,070 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,373 software developers and data experts.

how to grab content from another site

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
5 3210
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Baby Blue | last post by:
I have 2 code like below to grab a news website for my site. However, when I click some links (such as : http://wwww.vnexpress.net/xxx/xxxx ) inside the site which I want to grab, it has some...
3
by: Baby Blue | last post by:
I have 2 codes below to grap data from another site. I use them to get the data from one News site. However, when I click on some link inside (such as :...
12
by: jonathan.beckett | last post by:
Hi All, For the past few months I have been working on an open source Apache/PHP/MySQL content management system - and have recently made it available for download. It's still very much a...
0
by: jonathan.beckett | last post by:
Hi All, I have just made version 0.4.8 of the PluggedOut CMS Content Management System available for download - it's free, and covered by the GPL. It's still very much a work in progress...
3
by: Andy Kasotia | last post by:
On the client once the user clicks the Submit button....in my code the following javascript function kicks off... onclick="return SubmitForm('frmCurrBuildings', 'CurrBuildings.asp', c_iLOADNEW,...
3
by: James | last post by:
Hi guys, I have been building a search engine here - not because I have plans of dethrowning Google but as a simple app upon which to develop a function set that I can use for other things. ...
7
by: Water Cooler v2 | last post by:
I know what it is, and yet the knowledge of what a CMS is, is so vague that I find myself asking this question every now and then. I've googled and read the resources too. However, the knowledge is...
0
by: Grey | last post by:
i need to grab the pdf content. the pdf content has the standard format with data inside. is there any way to 1) grab the table content in pdf format; and then 2) put the data into excel
1
by: helraizer1 | last post by:
Hi folks and folksesses, In the GD2 library there is a function called 'imagegrabscreen()' and 'imagegrabwindow()', which captures a screen dump of the current window, or another one specified by...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.