473,396 Members | 1,804 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,396 software developers and data experts.

Extracting HTML link fragment

goatboy
I recently decided to start learning Perl. I usually choose something useful for my first project in any language, so I decided to write a script to give information based upon a supplied MAC address.

Everything in the script works fine, until I try to display the MAC vendor.

In order to do so, I supply the MAC address as a query to a website which checks it against a database. That website then displays the vendor in the page in the form of a link to a Google search.

I am able to get the HTML contents just fine, but I need to get the Google search argument. For example, if my MAC address is 00:11:22:33:44:55, the website will return a link to "http://www.google.com/search?q=CIMSYS Inc"

I need to be able to extract and display the "CIMSYS Inc" part of that particular link. So far, I have tried several regular expressions to no avail. I have messed around with HTML::SimpleLinkExtor, HTML::Parser, and a few others. They seem to be what I need, but for some reason or another I am not using them correctly.

Can someone give some insight to this? I don't want to be spoonfed, but rather given a push in the right direction from someone who has done this before.

As always, any (useful) input is appreciated.
Jan 26 '10 #1
3 1911
RonB
589 Expert Mod 512MB
Net::MAC::Vendor - look up the vendor for a MAC
http://search.cpan.org/~bdfoy/Net-MA.../lib/Vendor.pm
Jan 26 '10 #2
FML

It seems every idea I have has already been done and turned into a module of some sort! Well, that's the beauty of code, I suppose.

However, for the sake of learning, I'm still interested in a way to selectively pull text from a page.
Jan 26 '10 #3
RonB
589 Expert Mod 512MB
Have you tried HTML::LinkExtor - Extract links from an HTML document
http://search.cpan.org/~gaas/HTML-Pa...L/LinkExtor.pm
Jan 26 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: VK | last post by:
09/30/03 Phil Powell posted his "Radio buttons do not appear checked" question. This question led to a long discussion about the naming rules applying to variables, objects, methods and properties...
5
by: karl_lopes | last post by:
Hi, I was looking for any validation code in javascript which essentially does the same thing as html tidy. i.e. The user enters some data in a form text area and I want to perform a client side...
8
by: John M. Gabriele | last post by:
I'm putting together a small site using Python and cgi. (I'm pretty new to this, but I've worked a little with JSP/servlets/Java before.) Almost all pages on the site will share some common...
4
by: kirill_uk | last post by:
Help with extracting please folks.! Hi. I have this: a variable like: <a href="http://www.some_html.com/text.html" >some text</a><br> I heed to extract the "http://www.some_html.com/text.html "...
4
by: Moogy | last post by:
I'm pulling my hair out here. First, I'm new to XML, so that doesn't help, but none of this makes any sense to me. All I'm trying to do is take a simple source XML file and translate it with an...
3
by: Grant Harmeyer | last post by:
Ok: I have done small level Xml stuff and am just now starting to understand some of the plumbing involved. I've done a lot of .NET programming for SQL Server, but little for Xml data stores. ...
14
by: Adnan Siddiqi | last post by:
Hi Suppose I have following URLs comming from an HTML document <a href="http://mydomain1.com">Domain1</a> <a...
3
by: matt | last post by:
hello, i have a usercontrol in my app that draws a DropDownList and some text. elsewhere, i have a need to extract the control's HTML as if it had been rendered in-page. typically, when i...
3
by: Johny | last post by:
Does anyone know about a good regular expression for URL extracting? J.
2
by: s. d. rose | last post by:
Hello All. I am learning Python, and have never worked with HTML. However, I would like to write a simple script to audit my 100+ Netware servers via their web portal. I was reading Chapter 8...
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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.