Sponsored Content
Top Forums Shell Programming and Scripting Extract URLs from HTML code using sed Post 302375711 by ippy98 on Sunday 29th of November 2009 04:31:05 AM
Old 11-29-2009
try single ' instead of " on the sed command:

Code:
sed 's/<p><a href=\([^>]*\).*/\1/'

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How do I extract text only from html file without HTML tag

I have a html file called myfile. If I simply put "cat myfile.html" in UNIX, it shows all the html tags like <a href=r/26><img src="http://www>. But I want to extract only text part. Same problem happens in "type" command in MS-DOS. I know you can do it by opening it in Internet Explorer,... (4 Replies)
Discussion started by: los111
4 Replies

2. UNIX for Advanced & Expert Users

sed to extract HTML content

Hiya, I am trying to extract a news article from a web page. The sed I have written brings back a lot of Javascript code and sometimes advertisments too. Can anyone please help with this one ??? I need to fix this sed so it picks up the article ONLY (don't worry about the title or date .. i got... (2 Replies)
Discussion started by: stargazerr
2 Replies

3. Shell Programming and Scripting

sed to extract only floating point numbers from HTML

Hi All, I'm trying to extract some floating point numbers from within some HTML code like this: <TR><TD class='awrc'>Parse CPU to Parse Elapsd %:</TD><TD ALIGN='right' class='awrc'> 64.50</TD><TD class='awrc'>% Non-Parse CPU:</TD><TD ALIGN='right' class='awrc'> ... (2 Replies)
Discussion started by: pondlife
2 Replies

4. Shell Programming and Scripting

SED to extract HTML text data, not quite right!

I am attempting to extract weather data from the following website, but for the Victoria area only: Text Forecasts - Environment Canada I use this: sed -n "/Greater Victoria./,/Fraser Valley./p" But that phrasing does not sometimes get it all and think perhaps the website has more... (2 Replies)
Discussion started by: lagagnon
2 Replies

5. Shell Programming and Scripting

Extract urls from index.html downloaded using wget

Hi, I need to basically get a list of all the tarballs located at uri I am currently doing a wget on urito get the index.html page Now this index page contains the list of uris that I want to use in my bash script. can someone please guide me ,. I am new to Linux and shell scripting. ... (5 Replies)
Discussion started by: mnanavati
5 Replies

6. Shell Programming and Scripting

Remove external urls from .html file

Hi everyone. I have an html file with lines like so: link href="localFolder/..."> link href="htp://..."> img src="localFolder/..."> img src="htp://..."> I want to remove the links with http in the href and imgs with http in its src. I'm having trouble removing them because there... (4 Replies)
Discussion started by: CowCow339
4 Replies

7. Shell Programming and Scripting

help with sed needed to extract content from html tags

Hi I've searched for it for few hours now and i can't seem to find anything working like i want. I've got webpage, saved in file par with form like this: <html><body><form name='sendme' action='http://example.com/' method='POST'> <textarea name='1st'>abc123def678</textarea> <textarea... (9 Replies)
Discussion started by: seb001
9 Replies

8. Shell Programming and Scripting

How to remove urls from html files

Does anybody know how to remove all urls from html files? all urls are links with anchor texts in the form of <a href="http://www.anydomain.com">ANCHOR</a> they may start with www or not. Goal is to delete all urls and keep the ANCHOR text and if possible to change tags around anchor to... (2 Replies)
Discussion started by: georgi58
2 Replies

9. Shell Programming and Scripting

Trying to extract domain and tld from list of urls.

I have done a fair amount of searching the threads, but I have not been able to cobble together a solution to my challenge. What I am trying to do is to line edit a file that will leave behind only the domain and tld of a long list of urls. The list looks something like this: www.google.com... (3 Replies)
Discussion started by: chamb1
3 Replies

10. Shell Programming and Scripting

Awk/sed HTML extract

I'm extracting text between table tags in HTML <th><a href="/wiki/Buick_LeSabre" title="Buick LeSabre">Buick LeSabre</a></th> using this: awk -F "</*th>" '/<\/*th>/ {print $2}' auto2 > auto3 then this (text between a href): sed -e 's/\(<*>\)//g' auto3 > auto4 How to shorten this into one... (8 Replies)
Discussion started by: p1ne
8 Replies
WWW::SearchResult(3pm)					User Contributed Perl Documentation				    WWW::SearchResult(3pm)

NAME
WWW::SearchResult - class for results returned from WWW::Search SYNOPSIS
require WWW::Search; require WWW::SearchResult; $search = new WWW::Search; $search->native_query(WWW::Search::escape_query($query)); # Get first result: $result = $search->next_result(); DESCRIPTION
A framework for returning the results of "WWW::Search". SEE ALSO
WWW::Search REQUIRED RESULTS
The particular fields returned in a result are backend- (search engine-) dependent. However, all search engines are required to return a url and title. (This list may grow in the future.) METHODS AND FUNCTIONS
new To create a new WWW::SearchResult, call $result = new WWW::SearchResult(); url Returns the primary URL. Note that there may be a list of urls, see also methods "urls" and "add_url". Nothing special is guaranteed about the primary URL other than that it is the first one returned by the back end. Every result is required to have at least one URL. add_url Add a URL to the list. urls Return a reference to the list of urls. There is also a primary URL ("url"). add_related_url Add a URL to the related_url list. related_urls Return a reference to the list of related urls. add_related_title Add a title to the list or related titles. related_titles Return a reference to the list of related titles. title, description, score, change_date, index_date, size, raw Set or get attributes of the result. None of these attributes is guaranteed to be provided by a given backend. If an attribute is not provided its method will return "undef". Typical contents of these attributes: title The title of the hit result (typically that provided by the 'TITLE' HTML tag). description A brief description of the result, as provided (or not) by the search engine. Often the first few sentences of the document. source Source is either the base url for this result (as listed on the search engine's results page) or another copy of the full url path of the result. It might also indicate the source site name or address whence the result came, for example, 'CNN' or 'http://www.cnn.com' if the search result page said "found at CNN.com". This value is backend-specific; in fact very few backends set this value. add_sources Same meaning as source above, for adding sources in case there are potentially multiple sources. sources Returns a reference to the list of sources. score A backend specific, numeric score of the search result. The exact range of scores is search-engine specific. Usually larger scores are better, but this is no longer required. See normalized_score for a backend independent score. normalized_score This is intended to be a backend-independent score of the search result. The range of this score is between 0 and 1000. Higher values indicate better quality results. This is not really implemented since no one has created an backend-independent ranking algorithm. change_date When the result was last changed. Typically this is the modification time of the destination web page. index_date When the search engine indexed the result. size The approximate size of the result, in bytes. This is only an approximation because search backends often report the size as "18.4K"; the best we can do with that number is return it as the value of 18.4 * 1024. raw The raw HTML for the entire result. Raw should be exactly the raw HTML for one entry. It should not include list or table setup commands (like ul or table tags), but it may include list item or table data commands (like li, tr, or td). Whether raw contains a list entry, table row, br-separated lines, or plain text is search-engine dependent. In fact, many backends do not even return it at all. as_HTML Convert the search result to a human-readable form, decorated with HTML for pretty-printing. Others More attributes of the result. Backend-specific. Refer to the documentation of each backend for details. bid_amount bid_count bidder category company end_date image_url item_number location question_count seller shipping sold start_date thumb_url watcher_count AUTHOR
WWW::SearchResult was written by John Heidemann. WWW::SearchResult is maintained by Martin Thurn. perl v5.12.4 2011-10-25 WWW::SearchResult(3pm)
All times are GMT -4. The time now is 11:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy