Sponsored Content
Top Forums Shell Programming and Scripting How to extract url from html page? Post 302463148 by kurumi on Saturday 16th of October 2010 01:09:10 AM
Old 10-16-2010
http://hpricot.com/
Code:
#!/usr/bin/env ruby -Ku

require 'hpricot'
doc = open("file"){|f|Hpricot(f)}
(doc/"a").each do |x|
 print "-->#{x.get_attribute("href)}, #{x.inner_text}\n"
end

Code:
$ ruby geturl.rb
-->http://awebsite, website
-->http://bwebsite, websiteb

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to get the page size (of a url) using wget

Hi , I am trying to get page size of a url(e.g.,www.example.com) using wget command.Any thoughts what are the parameters i need to send with wget to get the size alone? Regards, Raj (1 Reply)
Discussion started by: rajbal
1 Replies

2. 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

3. Solaris

Accessing a HTML page

Hi All, In our unix server we have an apache web server running. I can access the default apache web page from my windows machine. Now, I want to create my own webpage. Therefore I created webpage at /export/home/myname/test.html file. Where do I need to place this file and what do I need... (0 Replies)
Discussion started by: pkm_oec
0 Replies

4. Web Development

findstr in html page

I am planning to create an html page that will count number of connected ports, challenge for me is how to put it in a page. Thanks! (1 Reply)
Discussion started by: webmunkey23
1 Replies

5. UNIX for Dummies Questions & Answers

Publishing HTML Page

Hi All, Thanks for reading. I am not sure if I am asking this in the correct group. But here it goes: There is a shell script which does some system checks and creates an html file called system_summary.html on my Red Hat machine say in /reports directory every hour. Now I want to view it... (1 Reply)
Discussion started by: deepakgang
1 Replies

6. Red Hat

Publishing HTML Page

Hi All, Thanks for reading. I am not sure if I am asking this in the correct group. But here it goes: There is a shell script which does some system checks and creates an html file called system_summary.html on my Red Hat machine say in /reports directory every hour. Now I want to view it... (6 Replies)
Discussion started by: deepakgang
6 Replies

7. Shell Programming and Scripting

Extracting anchor text and its URL from HTML files in BASH

Hi All, I have some HTML files and my requirement is to extract all the anchor text words from the HTML files along with their URLs and store the result in a separate text file separated by space. For example, <a href="/kid/stay_healthy/">Staying Healthy</a> which has /kid/stay_healthy/ as... (3 Replies)
Discussion started by: shoaibjameel123
3 Replies

8. Shell Programming and Scripting

URL/HTML encoding

Hey guys, looking for a way to encode a string into URL and HTML in a bash script that I'm making to encode strings in various different digests etc. Can't find anything on it anywhere else on the forums. Any help much appreciated, still very new to bash and programming etc. (4 Replies)
Discussion started by: 3therk1ll
4 Replies

9. Shell Programming and Scripting

Use curl to send a static xml file using url encoding to a web page using pos

Hi I am try to use curl to send a static xml file using url encoding to a web page using post. This has to go through a particular port on our firewall as well. This is my first exposure to curl and am not having much success, so any help you can supply, or point me in the right direction would be... (1 Reply)
Discussion started by: Paul Walker
1 Replies

10. Post Here to Contact Site Administrators and Moderators

Page Not Found error while parsing url

Hi I just tried to post following link while answering, its not parsing properly, just try on your browser Tried to paste while answering : https://www.unix.com/302873559-post2.htmlNot operator is not coming with HTML/PHP tags so attaching file (2 Replies)
Discussion started by: Akshay Hegde
2 Replies
QHBoxLayout(3qt)														  QHBoxLayout(3qt)

NAME
QHBoxLayout - Lines up widgets horizontally SYNOPSIS
#include <qlayout.h> Inherits QBoxLayout. Public Members QHBoxLayout ( QWidget * parent, int margin = 0, int spacing = -1, const char * name = 0 ) QHBoxLayout ( QLayout * parentLayout, int spacing = -1, const char * name = 0 ) QHBoxLayout ( int spacing = -1, const char * name = 0 ) ~QHBoxLayout () DESCRIPTION
The QHBoxLayout class lines up widgets horizontally. This class is used to construct horizontal box layout objects. See QBoxLayout for more details. The simplest use of the class is like this: QBoxLayout * l = new QHBoxLayout( widget ); l->setAutoAdd( TRUE ); new QSomeWidget( widget ); new QSomeOtherWidget( widget ); new QAnotherWidget( widget ); or like this: QBoxLayout * l = new QHBoxLayout( widget ); l->addWidget( existingChildOfWidget ); l->addWidget( anotherChildOfWidget ); <center> [Image Omitted] </center> See also QVBoxLayout, QGridLayout, the Layout overview, Widget Appearance and Style, and Layout Management. MEMBER FUNCTION DOCUMENTATION
QHBoxLayout::QHBoxLayout ( QWidget * parent, int margin = 0, int spacing = -1, const char * name = 0 ) Constructs a new top-level horizontal box called name, with parent parent. The margin is the number of pixels between the edge of the widget and its managed children. The spacing is the default number of pixels between neighboring children. If spacing is -1 the value of margin is used for spacing. QHBoxLayout::QHBoxLayout ( QLayout * parentLayout, int spacing = -1, const char * name = 0 ) Constructs a new horizontal box called name name and adds it to parentLayout. The spacing is the default number of pixels between neighboring children. If spacing is -1, this QHBoxLayout will inherit its parent's spacing(). QHBoxLayout::QHBoxLayout ( int spacing = -1, const char * name = 0 ) Constructs a new horizontal box called name name. You must add it to another layout. The spacing is the default number of pixels between neighboring children. If spacing is -1, this QHBoxLayout will inherit its parent's spacing(). QHBoxLayout::~QHBoxLayout () Destroys this box layout. The layout's widgets aren't destroyed. SEE ALSO
http://doc.trolltech.com/qhboxlayout.html http://www.trolltech.com/faq/tech.html COPYRIGHT
Copyright 1992-2001 Trolltech AS, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. AUTHOR
Generated automatically from the source code. BUGS
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qhboxlayout.3qt) and the Qt version (3.1.1). Trolltech AS 9 December 2002 QHBoxLayout(3qt)
All times are GMT -4. The time now is 10:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy