473,382 Members | 1,421 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Parsing text file with ASP

I have a text file that is the result of using XMLHTTP object to pull back a
page of search results from a search engine.

So I have the entire results page in HTML, and want to break out each hit
result from the text file as a unique item and do what I want with each hit
result.

Is there any suggested algorithms or any other techniques I could be
directed to?
Jul 19 '05 #1
5 1910
What exactly is a "hit result?" As far as what you want to do, it'd all
depend on what the html looks like and how consistent it remains. Do you
have control over this remote source? Or is it some other site that can
change on any given day without any forewarning?

Ray at home

"SROSeaner" <SR*******@discussions.microsoft.com> wrote in message
news:F9**********************************@microsof t.com...
I have a text file that is the result of using XMLHTTP object to pull back
a
page of search results from a search engine.

So I have the entire results page in HTML, and want to break out each hit
result from the text file as a unique item and do what I want with each
hit
result.

Is there any suggested algorithms or any other techniques I could be
directed to?

Jul 19 '05 #2
Actually, all I really need to do is pull out any text in the HTML text that
is a web site address, so, in the form of http://www._____.__ or starting
with www.

I think I know how to find that, by using InStr and passing it http: (for
example) as the text to look for, but, that will only give me the starting
point of the address correct?

"Ray Costanzo [MVP]" wrote:
What exactly is a "hit result?" As far as what you want to do, it'd all
depend on what the html looks like and how consistent it remains. Do you
have control over this remote source? Or is it some other site that can
change on any given day without any forewarning?

Ray at home

"SROSeaner" <SR*******@discussions.microsoft.com> wrote in message
news:F9**********************************@microsof t.com...
I have a text file that is the result of using XMLHTTP object to pull back
a
page of search results from a search engine.

So I have the entire results page in HTML, and want to break out each hit
result from the text file as a unique item and do what I want with each
hit
result.

Is there any suggested algorithms or any other techniques I could be
directed to?


Jul 19 '05 #3
Yes, that'd give you the starting point. The best you can do is have your
code make an educated guess about things when you have no idea what kind of
data will be thrown at it.

If the string contains:

<a href="http://something.com">click me</a>, should it be ignored because
there's no WWW? Should your code assume that as soon as it finds a ", then
then that is the end of the domain? What about a carriage return? What
about a < character? What about when it's in a sentence in the document,
eg.

Most Web site addresses start with http://www.

Should that be found?

There are lots of variables to deal with, and all you can really do is hope
for accuracy.

Ray at work
"SROSeaner" <SR*******@discussions.microsoft.com> wrote in message
news:2F**********************************@microsof t.com...
Actually, all I really need to do is pull out any text in the HTML text
that
is a web site address, so, in the form of http://www._____.__ or starting
with www.

I think I know how to find that, by using InStr and passing it http: (for
example) as the text to look for, but, that will only give me the starting
point of the address correct?

"Ray Costanzo [MVP]" wrote:
What exactly is a "hit result?" As far as what you want to do, it'd all
depend on what the html looks like and how consistent it remains. Do you
have control over this remote source? Or is it some other site that can
change on any given day without any forewarning?

Ray at home

"SROSeaner" <SR*******@discussions.microsoft.com> wrote in message
news:F9**********************************@microsof t.com...
>I have a text file that is the result of using XMLHTTP object to pull
>back
>a
> page of search results from a search engine.
>
> So I have the entire results page in HTML, and want to break out each
> hit
> result from the text file as a unique item and do what I want with each
> hit
> result.
>
> Is there any suggested algorithms or any other techniques I could be
> directed to?


Jul 19 '05 #4
You have DOM parsers available but your code will break if the architecture
of the page change. I would rather use an API or a "service" if
available....

Patrice

--

"SROSeaner" <SR*******@discussions.microsoft.com> a écrit dans le message de
news:2F**********************************@microsof t.com...
Actually, all I really need to do is pull out any text in the HTML text that is a web site address, so, in the form of http://www._____.__ or starting
with www.

I think I know how to find that, by using InStr and passing it http: (for
example) as the text to look for, but, that will only give me the starting
point of the address correct?

"Ray Costanzo [MVP]" wrote:
What exactly is a "hit result?" As far as what you want to do, it'd all
depend on what the html looks like and how consistent it remains. Do you have control over this remote source? Or is it some other site that can
change on any given day without any forewarning?

Ray at home

"SROSeaner" <SR*******@discussions.microsoft.com> wrote in message
news:F9**********************************@microsof t.com...
I have a text file that is the result of using XMLHTTP object to pull backa
page of search results from a search engine.

So I have the entire results page in HTML, and want to break out each hit result from the text file as a unique item and do what I want with each hit
result.

Is there any suggested algorithms or any other techniques I could be
directed to?


Jul 19 '05 #5
Thanks for your help guys. I figure I will just have to code it in a way to
take care of all the variables in such a situation.

"Patrice" wrote:
You have DOM parsers available but your code will break if the architecture
of the page change. I would rather use an API or a "service" if
available....

Patrice

--

"SROSeaner" <SR*******@discussions.microsoft.com> a écrit dans le message de
news:2F**********************************@microsof t.com...
Actually, all I really need to do is pull out any text in the HTML text

that
is a web site address, so, in the form of http://www._____.__ or starting
with www.

I think I know how to find that, by using InStr and passing it http: (for
example) as the text to look for, but, that will only give me the starting
point of the address correct?

"Ray Costanzo [MVP]" wrote:
What exactly is a "hit result?" As far as what you want to do, it'd all
depend on what the html looks like and how consistent it remains. Do you have control over this remote source? Or is it some other site that can
change on any given day without any forewarning?

Ray at home

"SROSeaner" <SR*******@discussions.microsoft.com> wrote in message
news:F9**********************************@microsof t.com...
>I have a text file that is the result of using XMLHTTP object to pull back >a
> page of search results from a search engine.
>
> So I have the entire results page in HTML, and want to break out each hit > result from the text file as a unique item and do what I want with each > hit
> result.
>
> Is there any suggested algorithms or any other techniques I could be
> directed to?


Jul 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: ralphNOSPAM | last post by:
Is there a function or otherwise some way to pull out the target text within an XML tag? For example, in the XML tag below, I want to pull out 'CALIFORNIA'. ...
3
by: Pir8 | last post by:
I have a complex xml file, which contains stories within a magazine. The structure of the xml file is as follows: <?xml version="1.0" encoding="ISO-8859-1" ?> <magazine> <story>...
26
by: SL33PY | last post by:
Hi, I'm having a problem parsing strings (comming from a flat text input file) to doubles. the code: currentImportDetail.Result = CType(line.Substring(7, 8).Trim(" "), System.Double) What...
1
by: Thomas Kowalski | last post by:
Hi, I have to parse a plain, ascii text file (on local HD). Since the file might be many millions lines long I want to improve the efficiency of my parsing process. The resulting data structure...
4
by: Neil.Smith | last post by:
I can't seem to find any references to this, but here goes: In there anyway to parse an html/aspx file within an asp.net application to gather a collection of controls in the file. For instance...
3
by: toton | last post by:
Hi, I have some ascii files, which are having some formatted text. I want to read some section only from the total file. For that what I am doing is indexing the sections (denoted by .START in...
2
by: hzgt9b | last post by:
I've written a simple javascript page that parses an XML file... (Actually I just modified the "Parsing an XML File" sample from http://www.w3schools.com/dom/dom_parser.asp) The page works great...
13
by: Chris Carlen | last post by:
Hi: Having completed enough serial driver code for a TMS320F2812 microcontroller to talk to a terminal, I am now trying different approaches to command interpretation. I have a very simple...
1
by: martinsson | last post by:
Hi all! I'm pretty mad about this... dont know what is going on. Im parsing XML file that looks like this: <something> __<item att="something">text<item> __<item...
2
by: python | last post by:
I'm parsing a text file for a proprietary product that has the following 2 directives: #include <somefile> #define <name<value> Defined constants are referenced via <#name#syntax. I'm...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

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.