hpricot
Getting portion of href attribute using hpricot
I think I need a combo of hpricot and regex here. I need to search for \'a\' tags with an \'href\' attribute that starts with \'abc/\', and returns the text following that until the next forward slash[详细]
2023-01-23 07:49 分类:问答HPricot css search: How do I select the parent/ancestor of a particular element using a string selector?
I\'m using HPricot\'s css search to identify a table withi开发者_开发百科n a web page. Here\'s a sample html snippet I\'m parsing:[详细]
2023-01-22 04:13 分类:问答RoR: Storing HTML in a File for Later Use
In our application we have different themes and each theme has its own default content in the following structure:[详细]
2023-01-21 00:19 分类:问答XML to hash table in Ruby: Parsing list of historical inventions
I\'d like to slurp the following data about historical inventions into a convenient Ruby data structure:[详细]
2023-01-18 02:11 分类:问答how does one remove <![CDATA[ ]]> tags from around text in XML using Hpricot?
i just want the text out of there wit开发者_JAVA百科h out those tags. Does Hrpicot.XML have any methods for this? use element.inner_text instead of #inner_html and it removes them for youdoc.search(\"[详细]
2023-01-12 20:13 分类:问答Getting largest image from a page via Hpricot
I\'m trying to get the largest image off a page I parse with Hpricot and am not having any luck. How do I access the width and height attributes of an img tag with i开发者_如何学Got?It is possible, pr[详细]
2023-01-10 21:36 分类:问答Remove an element's class attribute with Hpricot
How do I do it开发者_如何学运维? E.g., <span class=\"selected\" id=\"hi\">HELLO</span>[详细]
2023-01-07 13:44 分类:问答Encoding problems with hpricot
I am getting the following encoding error when trying to scrape web pages with hpricot in ruby 1.9: Encoding::CompatibilityError: incompatible character encodings: ASCII-8BIT and UTF-8[详细]
2023-01-05 13:47 分类:问答Scraping pages with asynchronous responses with Hpricot
I\'m trying to scrape a page but the initial response has nothing in the body as the content is pumped in asynchronous开发者_C百科ly, e.g. the results from a search on the apple website: http://www.ap[详细]
2023-01-04 10:19 分类:问答Ruby: Computed Style for a webpage
I\'m using Hpricot to parse an html page, but need to get the computed styles for each element.F开发者_开发问答or example, if I have an h1 Hpricot element and the external CSS for the page has a backg[详细]
2023-01-04 08:12 分类:问答