pstuteville-scrubyt 0.4.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +355 -0
- data/COPYING +340 -0
- data/README.rdoc +121 -0
- data/Rakefile +120 -0
- data/VERSION +1 -0
- data/examples/README.txt +1 -0
- data/examples/events/delta/input.html +682 -0
- data/examples/events/delta/test.rb +16 -0
- data/examples/misc/auto_regex/input.html +22 -0
- data/examples/misc/auto_regex/test.rb +14 -0
- data/examples/misc/compound_example/advanced/test.rb +11 -0
- data/examples/misc/compound_example/advanced/tricky_compound.html +9 -0
- data/examples/misc/compound_example/regexp/regexp_compound.html +17 -0
- data/examples/misc/compound_example/regexp/test.rb +11 -0
- data/examples/misc/compound_example/simple/compound.html +5 -0
- data/examples/misc/compound_example/simple/test.rb +11 -0
- data/examples/misc/detail_page/detailpage.html +6 -0
- data/examples/misc/detail_page/index.html +9 -0
- data/examples/misc/detail_page/test.rb +17 -0
- data/examples/misc/google/test.rb +39 -0
- data/examples/misc/identical_examples/data_extractor_export.rb +12 -0
- data/examples/misc/identical_examples/input.html +16 -0
- data/examples/misc/identical_examples/test.rb +15 -0
- data/examples/misc/immediate_attribute_extraction/data_extractor_export.rb +10 -0
- data/examples/misc/immediate_attribute_extraction/input.html +16 -0
- data/examples/misc/immediate_attribute_extraction/test.rb +14 -0
- data/examples/misc/multiple_examples/input.html +7 -0
- data/examples/misc/multiple_examples/test.rb +22 -0
- data/examples/misc/on_click_next/next_page_link.rb +42 -0
- data/examples/misc/on_click_next/page_1.html +10 -0
- data/examples/misc/on_click_next/page_2.html +10 -0
- data/examples/misc/on_click_next/page_3.html +7 -0
- data/examples/misc/rubycorner/test.rb +29 -0
- data/examples/misc/rubyforge_login/test.rb +30 -0
- data/examples/misc/tables/ambigous_records/input.html +17 -0
- data/examples/misc/tables/ambigous_records/test.rb +37 -0
- data/examples/misc/tables/another_plain_table/input.html +15 -0
- data/examples/misc/tables/another_plain_table/test.rb +25 -0
- data/examples/misc/tables/complex_table/input.html +45 -0
- data/examples/misc/tables/complex_table/test.rb +30 -0
- data/examples/misc/tables/grab_rows/input.html +20 -0
- data/examples/misc/tables/grab_rows/test.rb +30 -0
- data/examples/misc/tables/plain_table/input.html +39 -0
- data/examples/misc/tables/plain_table/test.rb +35 -0
- data/examples/misc/tables/plain_table_morepages/2.html +38 -0
- data/examples/misc/tables/plain_table_morepages/3.html +33 -0
- data/examples/misc/tables/plain_table_morepages/input.html +40 -0
- data/examples/misc/tables/plain_table_morepages/test.rb +32 -0
- data/examples/misc/tables/plain_table_morepages_with_image/2.html +40 -0
- data/examples/misc/tables/plain_table_morepages_with_image/3.html +33 -0
- data/examples/misc/tables/plain_table_morepages_with_image/images/right_arrow.png +0 -0
- data/examples/misc/tables/plain_table_morepages_with_image/input.html +42 -0
- data/examples/misc/tables/plain_table_morepages_with_image/test.rb +32 -0
- data/examples/misc/tables/test_select_indices/input.html +46 -0
- data/examples/misc/tables/test_select_indices/test.rb +55 -0
- data/examples/misc/xpath_example_type/input.html +15 -0
- data/examples/misc/xpath_example_type/test.rb +18 -0
- data/examples/misc/yahoo_finance/test.rb +26 -0
- data/examples/social/blog_comment/test.rb +27 -0
- data/examples/social/del.icio.us/test.rb +22 -0
- data/examples/social/digg/test.rb +37 -0
- data/examples/social/dzone/test.rb +28 -0
- data/examples/social/linkedin/linkedin.rb +23 -0
- data/examples/social/reddit/test.rb +23 -0
- data/examples/tones_extractor_export.rb +23 -0
- data/examples/webshops/amazon/002-8212888-3924065.html +5311 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/0130796034.jpg +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/020161622X.jpg +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/0321223675.jpg +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/0465067107.jpg +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/0470069155.jpg +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/0470081201.jpg +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/0596005253.jpg +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/0596101325.jpg +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/0596523696.jpg +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/0672328844.jpg +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/0764596861.jpg +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/0974514055.jpg +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/0976694069.jpg +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/0977616606.jpg +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/0977616614.jpg +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/0977616630.jpg +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/1590597362.jpg +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/1594480060.jpg +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/1932394699.jpg +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/2841772101.jpg +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/amzn-logo-118w.gif +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/askville-adwidget-bullet.gif +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/askville-logo-sm-adwidget-white-bg.gif +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/book_display_on_website-icon.gif +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/btn-inactive-no-ns.gif +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/btn-inactive-no.gif +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/btn-inactive-yes-ns.gif +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/btn-inactive-yes.gif +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/btn-no-tiny.gif +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/btn-yes-tiny.gif +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/buybox-button-find-gifts-a.gif +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/c7y_badge_rn_1.gif +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/cap-a9-3.gif +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/drop-down-icon-small-arrow.gif +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/endcap-a9-go-2.gif +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/gb-open-new.gif +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/gc-logo-popover-a.gif +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/gift-cert-roto-pop-a.gif +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/go-button-books.gif +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/go-button.gif +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/go-orange-trans.gif +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/go_button_photo.gif +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/logo-off.gif +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/n2CoreLibs-events-18134.js +1407 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/n2CoreLibs-n2v1-57871.css +364 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/n2CoreLibs-simplePopover-41153.js +749 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/n2CoreLibs-utilities-25439.js +1608 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/orange-arrow.gif +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/orange-arrow_002.gif +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/popover-blurb.gif +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/powered-by-a9.gif +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/stars-3-5.gif +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/stars-4-0.gif +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/stars-4-5.gif +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/stars-5-0.gif +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/tagline-adwidget.gif +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/topnav-cart.gif +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/transparent-pixel.gif +0 -0
- data/examples/webshops/amazon/002-8212888-3924065_files/transparent-pixel_002.gif +0 -0
- data/examples/webshops/amazon/test.rb +27 -0
- data/examples/webshops/amazon-online/test.rb +34 -0
- data/examples/webshops/barnes_and_noble/test.rb +32 -0
- data/examples/webshops/barnes_offline/barnes_and_noble.html +115 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/10964080.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/10999676.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/11018492.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/11656534.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/11985045.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/12052378.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/12138286.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/12533212.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/12533268.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/9583392.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/SearchProduct.css +626 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/admin3_gtpointup.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/admin_aboutshipping.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/admin_account.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/admin_colon.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/admin_giftreminder.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/admin_help.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/admin_orderstatus.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/admin_wishlist.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/bg.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/btnGoGrn.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/cleardot.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/cleardot_002.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/dot4.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/dotGold20.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/hdCantFind.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/hdSearchResults.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/hgg_tab_home_cold.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/hgg_tab_toy_cold.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/iframeKMP.js +172 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/kmp_iframe_cds2.html +25 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/kmp_iframe_cds2_data/070226_mc_lnav_search.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/kmp_iframe_cds2_data/XmlUtil.js +199 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/kmp_iframe_cds2_data/XslStyleSheet.js +1 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/kmp_iframe_cds2_data/kmp_gen.css +81 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/kmp_iframe_cds2_data/product-preview-core.js +337 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/kmp_iframe_cds2_data/product-preview.css +36 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/kmp_iframe_cds2_data/productpreview.js +11 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/linePagination.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/logo_bn05.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/navbar.js +34 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/navbar_06.css +136 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/popup_open.js +116 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/qsearch3_vline_dots.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/qsearch4_search.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/qsearch_AdvSearch.jpg +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/subnav_colon.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/tab_Bookclubs_cold.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/tab_bnjr_cold.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/tab_books_hot.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/tab_dvd_cold.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/tab_giftcards_cold.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/tab_home_cold.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/tab_member_cc_cold.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/tab_music_cold.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/tab_pipe.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/tab_textbooksonly_cold.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/tab_usedoop_cold.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/tab_videogames_cold.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/toppromo3_rule.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/toppromo_fastfree05.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/vcart_btn_checkout.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/vcart_icon_cart.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/vcart_topbot_rule.gif +0 -0
- data/examples/webshops/barnes_offline/barnes_and_noble_files/visualcart_prodid.js +401 -0
- data/examples/webshops/barnes_offline/test.rb +30 -0
- data/examples/webshops/buydig/2_files/03AA1BB9089A4A6A92CF23F280D664EB.jpg +0 -0
- data/examples/webshops/buydig/2_files/1008.gif +0 -0
- data/examples/webshops/buydig/2_files/1013.gif +0 -0
- data/examples/webshops/buydig/2_files/1020.gif +0 -0
- data/examples/webshops/buydig/2_files/106CF2FB84B446518397517C3E6D5AD8.jpg +0 -0
- data/examples/webshops/buydig/2_files/13-www.gif +0 -0
- data/examples/webshops/buydig/2_files/1E9BB2E56AB145FC9D6EF952703AF476.jpg +0 -0
- data/examples/webshops/buydig/2_files/1FCDFBE85CDB4D429EC2C8CB24D20457.jpg +0 -0
- data/examples/webshops/buydig/2_files/1pix.gif +0 -0
- data/examples/webshops/buydig/2_files/2014.gif +0 -0
- data/examples/webshops/buydig/2_files/2089.gif +0 -0
- data/examples/webshops/buydig/2_files/24992_medal.gif +0 -0
- data/examples/webshops/buydig/2_files/24BBCBA1397F4DDCBBBBE8456D6D6E5B.jpg +0 -0
- data/examples/webshops/buydig/2_files/281F8A6019B140F38DFD45EB7B69B0FB.jpg +0 -0
- data/examples/webshops/buydig/2_files/2975F866CB2149F7ACBC559C8E24E304.jpg +0 -0
- data/examples/webshops/buydig/2_files/316FC9256DC9460ABC3C5ECAF6C60286.jpg +0 -0
- data/examples/webshops/buydig/2_files/50569327D8B94252B95E449AE470E505.jpg +0 -0
- data/examples/webshops/buydig/2_files/519CDAB404FA4543B76B5F281468ACBF.jpg +0 -0
- data/examples/webshops/buydig/2_files/57D6146419A647BA89C96AF0B5CAB03C.jpg +0 -0
- data/examples/webshops/buydig/2_files/58E3F988E184448B8C0A59874AE123A8.jpg +0 -0
- data/examples/webshops/buydig/2_files/5E5B10197A4E4C9B9ECCD6309DBE4C54.jpg +0 -0
- data/examples/webshops/buydig/2_files/609A249177D04065B37B9161CB0BC92D.jpg +0 -0
- data/examples/webshops/buydig/2_files/676CEE8E53C2445982E991871B4DF613.jpg +0 -0
- data/examples/webshops/buydig/2_files/712BA08FAB524A31A76ABB9E2009FF8E.jpg +0 -0
- data/examples/webshops/buydig/2_files/734BD08D7A5049339393166491D09D21.jpg +0 -0
- data/examples/webshops/buydig/2_files/751E72B7003343248497FE6905F80787.jpg +0 -0
- data/examples/webshops/buydig/2_files/76493D4F02F14EF7B5886510604C7BB4.jpg +0 -0
- data/examples/webshops/buydig/2_files/79521E251278486DB29529C60C9D012A.jpg +0 -0
- data/examples/webshops/buydig/2_files/9C9AF82AC3B54BDC8C705278B50FDFD6.jpg +0 -0
- data/examples/webshops/buydig/2_files/BC3FD8307B9948FDB7EEF156D8629C37.jpg +0 -0
- data/examples/webshops/buydig/2_files/C0DD4574765047D1836F505E69DC8AE5.jpg +0 -0
- data/examples/webshops/buydig/2_files/C143F48515274A44B04F4B3E46306BD2.jpg +0 -0
- data/examples/webshops/buydig/2_files/C6B02E88F729464699DB275D140F4563.jpg +0 -0
- data/examples/webshops/buydig/2_files/CE334D6206DB4FA9AFDF339AEF0AF50F.jpg +0 -0
- data/examples/webshops/buydig/2_files/D66AE0DC865A4021AB300ED3A0C4CD11.jpg +0 -0
- data/examples/webshops/buydig/2_files/DEA2EC2093DC474D96B651068576DAE5.jpg +0 -0
- data/examples/webshops/buydig/2_files/F547677D83844042BF13A4BE6523BB50.jpg +0 -0
- data/examples/webshops/buydig/2_files/Rbbbonlineseal.gif +0 -0
- data/examples/webshops/buydig/2_files/TopSellers_bottom.gif +0 -0
- data/examples/webshops/buydig/2_files/TopSellers_ttl.gif +0 -0
- data/examples/webshops/buydig/2_files/addToFavorites_ttl.gif +0 -0
- data/examples/webshops/buydig/2_files/banner_CorporateSales.gif +0 -0
- data/examples/webshops/buydig/2_files/banner_Shipping.gif +0 -0
- data/examples/webshops/buydig/2_files/bizratehonoree.gif +0 -0
- data/examples/webshops/buydig/2_files/btn_submit.gif +0 -0
- data/examples/webshops/buydig/2_files/checkFlash.js +110 -0
- data/examples/webshops/buydig/2_files/checkFlash2.js +109 -0
- data/examples/webshops/buydig/2_files/cnetcertified.gif +0 -0
- data/examples/webshops/buydig/2_files/credPriceGrabber.gif +0 -0
- data/examples/webshops/buydig/2_files/credShopping.gif +0 -0
- data/examples/webshops/buydig/2_files/credential_paypal.gif +0 -0
- data/examples/webshops/buydig/2_files/credentials.gif +0 -0
- data/examples/webshops/buydig/2_files/dealtime.gif +0 -0
- data/examples/webshops/buydig/2_files/dvxstyle.css +754 -0
- data/examples/webshops/buydig/2_files/footer_021306_1_v1.gif +0 -0
- data/examples/webshops/buydig/2_files/func.js +132 -0
- data/examples/webshops/buydig/2_files/getseal +1 -0
- data/examples/webshops/buydig/2_files/help.gif +0 -0
- data/examples/webshops/buydig/2_files/home.gif +0 -0
- data/examples/webshops/buydig/2_files/java.js +155 -0
- data/examples/webshops/buydig/2_files/leftnv_help.gif +0 -0
- data/examples/webshops/buydig/2_files/logo.gif +0 -0
- data/examples/webshops/buydig/2_files/logo2.gif +0 -0
- data/examples/webshops/buydig/2_files/logo3.gif +0 -0
- data/examples/webshops/buydig/2_files/main.js +227 -0
- data/examples/webshops/buydig/2_files/mastercard_secured.gif +0 -0
- data/examples/webshops/buydig/2_files/newsBox_bkg.jpg +0 -0
- data/examples/webshops/buydig/2_files/newsBox_bottom.jpg +0 -0
- data/examples/webshops/buydig/2_files/newsBox_text.gif +0 -0
- data/examples/webshops/buydig/2_files/newsBox_ttl.jpg +0 -0
- data/examples/webshops/buydig/2_files/noimage75.gif +0 -0
- data/examples/webshops/buydig/2_files/orangeleftfrmbtm.gif +0 -0
- data/examples/webshops/buydig/2_files/pixel153.gif +0 -0
- data/examples/webshops/buydig/2_files/rightnv_bottom.gif +0 -0
- data/examples/webshops/buydig/2_files/search_btn_off.gif +0 -0
- data/examples/webshops/buydig/2_files/search_c1.gif +0 -0
- data/examples/webshops/buydig/2_files/search_c2.gif +0 -0
- data/examples/webshops/buydig/2_files/search_c3.gif +0 -0
- data/examples/webshops/buydig/2_files/search_c4.gif +0 -0
- data/examples/webshops/buydig/2_files/search_down.gif +0 -0
- data/examples/webshops/buydig/2_files/search_left.gif +0 -0
- data/examples/webshops/buydig/2_files/search_right.gif +0 -0
- data/examples/webshops/buydig/2_files/search_top.gif +0 -0
- data/examples/webshops/buydig/2_files/siteLinks_bottom.gif +0 -0
- data/examples/webshops/buydig/2_files/siteLinks_bullet.gif +0 -0
- data/examples/webshops/buydig/2_files/siteLinks_ttl.gif +0 -0
- data/examples/webshops/buydig/2_files/spacer.gif +0 -0
- data/examples/webshops/buydig/2_files/style.js +45 -0
- data/examples/webshops/buydig/2_files/styles.html +33 -0
- data/examples/webshops/buydig/2_files/track_orders.jpg +0 -0
- data/examples/webshops/buydig/2_files/urchin +534 -0
- data/examples/webshops/buydig/2_files/verified_by_visa.gif +0 -0
- data/examples/webshops/buydig/2_files/welcome.gif +0 -0
- data/examples/webshops/buydig/2_files/welcome_ttl.gif +0 -0
- data/examples/webshops/buydig/2_files/yahoologo.gif +0 -0
- data/examples/webshops/buydig/input.html +1194 -0
- data/examples/webshops/buydig/test.rb +31 -0
- data/examples/webshops/ebay/test.rb +32 -0
- data/examples/webshops/finewines_offline/_finewines.html +1739 -0
- data/examples/webshops/finewines_offline/_finewines_cut.html +371 -0
- data/examples/webshops/finewines_offline/_finewines_files/011064.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/012674.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/013268.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/013300.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/013409.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/014340.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/015073.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/015255.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/015479.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/015487.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/017038.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/017129.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/017145.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/017152.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/017285.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/017392.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/017400.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/019778.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/019786.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/020503.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/021253.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/021279.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/021337.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/021352.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/023002.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/023135.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/023143.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/023788.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/024166.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/024182.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/024216.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/027268.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/027516.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/027862.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/028118.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/028936.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/033894.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/033902.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/033910.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/033936.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/033944.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/033951.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/034553.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/034561.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/232439.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/237834.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/268359.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/289082.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/331603.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/369686.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/420257.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/422014.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/460410.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/480533.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/556795.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/597054.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/650606.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/652628.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/653790.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/658450.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/660027.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/660951.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/684514.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/685131.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/686865.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/699330.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/703017.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/703140.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/703850.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/717306.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/900274.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/938225.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/947440.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/951319.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/967893.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/981407.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/981613.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/982421.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/985598.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/986737.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/987503.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/992800.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/VintageslogoEN.gif +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/blanc-up.gif +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/btn_vintages_latest.gif +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/cc_en.gif +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/common.js +860 -0
- data/examples/webshops/finewines_offline/_finewines_files/drink.gif +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/drinkhold.gif +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/ec_en.gif +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/ev_en.gif +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/hold.gif +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/index-wines-features.jpg +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/indexSTYLE.css +398 -0
- data/examples/webshops/finewines_offline/_finewines_files/keyword_search.gif +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/mm_menu.js +1 -0
- data/examples/webshops/finewines_offline/_finewines_files/nr_en.gif +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/ontario_en.gif +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/popup.js +81 -0
- data/examples/webshops/finewines_offline/_finewines_files/releases_nav.js +229 -0
- data/examples/webshops/finewines_offline/_finewines_files/so_en.gif +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/spacer.gif +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/top.gif +0 -0
- data/examples/webshops/finewines_offline/_finewines_files/urchin.js +576 -0
- data/examples/webshops/finewines_offline/_finewines_files/wom_en.gif +0 -0
- data/examples/webshops/finewines_offline/test.rb +30 -0
- data/examples/webshops/us1camera/1_files/1pix.gif +0 -0
- data/examples/webshops/us1camera/1_files/1pix_002.gif +0 -0
- data/examples/webshops/us1camera/1_files/CnetCertified.gif +0 -0
- data/examples/webshops/us1camera/1_files/CyberSource.gif +0 -0
- data/examples/webshops/us1camera/1_files/Images50.gif +0 -0
- data/examples/webshops/us1camera/1_files/Images50_002.gif +0 -0
- data/examples/webshops/us1camera/1_files/Images50_003.gif +0 -0
- data/examples/webshops/us1camera/1_files/Images50_004.gif +0 -0
- data/examples/webshops/us1camera/1_files/Images50_005.gif +0 -0
- data/examples/webshops/us1camera/1_files/Images50_006.gif +0 -0
- data/examples/webshops/us1camera/1_files/PriceGrabber.gif +0 -0
- data/examples/webshops/us1camera/1_files/QSearch.gif +0 -0
- data/examples/webshops/us1camera/1_files/ban-m.jpg +0 -0
- data/examples/webshops/us1camera/1_files/banner1.bin +0 -0
- data/examples/webshops/us1camera/1_files/banner3.bin +0 -0
- data/examples/webshops/us1camera/1_files/block1.jpg +0 -0
- data/examples/webshops/us1camera/1_files/block2.jpg +0 -0
- data/examples/webshops/us1camera/1_files/block3.jpg +0 -0
- data/examples/webshops/us1camera/1_files/block4.jpg +0 -0
- data/examples/webshops/us1camera/1_files/block5.jpg +0 -0
- data/examples/webshops/us1camera/1_files/block6.jpg +0 -0
- data/examples/webshops/us1camera/1_files/bos.js +280 -0
- data/examples/webshops/us1camera/1_files/box1.jpg +0 -0
- data/examples/webshops/us1camera/1_files/box2.jpg +0 -0
- data/examples/webshops/us1camera/1_files/box3.jpg +0 -0
- data/examples/webshops/us1camera/1_files/box4.jpg +0 -0
- data/examples/webshops/us1camera/1_files/dot.jpg +0 -0
- data/examples/webshops/us1camera/1_files/eDevix.gif +0 -0
- data/examples/webshops/us1camera/1_files/electronics1.jpg +0 -0
- data/examples/webshops/us1camera/1_files/getseal +1 -0
- data/examples/webshops/us1camera/1_files/pride.jpg +0 -0
- data/examples/webshops/us1camera/1_files/search.jpg +0 -0
- data/examples/webshops/us1camera/1_files/sidebutton.jpg +0 -0
- data/examples/webshops/us1camera/1_files/sslroilogic.js +49 -0
- data/examples/webshops/us1camera/1_files/style.css +1 -0
- data/examples/webshops/us1camera/1_files/tl.html +2 -0
- data/examples/webshops/us1camera/input.html +548 -0
- data/examples/webshops/us1camera/test.rb +37 -0
- data/lib/scrubyt/core/navigation/agents/firewatir.rb +285 -0
- data/lib/scrubyt/core/navigation/agents/mechanize.rb +315 -0
- data/lib/scrubyt/core/navigation/fetch_action.rb +63 -0
- data/lib/scrubyt/core/navigation/navigation_actions.rb +107 -0
- data/lib/scrubyt/core/scraping/compound_example.rb +30 -0
- data/lib/scrubyt/core/scraping/constraint.rb +169 -0
- data/lib/scrubyt/core/scraping/constraint_adder.rb +49 -0
- data/lib/scrubyt/core/scraping/filters/attribute_filter.rb +14 -0
- data/lib/scrubyt/core/scraping/filters/base_filter.rb +112 -0
- data/lib/scrubyt/core/scraping/filters/constant_filter.rb +9 -0
- data/lib/scrubyt/core/scraping/filters/detail_page_filter.rb +37 -0
- data/lib/scrubyt/core/scraping/filters/download_filter.rb +64 -0
- data/lib/scrubyt/core/scraping/filters/html_subtree_filter.rb +9 -0
- data/lib/scrubyt/core/scraping/filters/regexp_filter.rb +13 -0
- data/lib/scrubyt/core/scraping/filters/script_filter.rb +11 -0
- data/lib/scrubyt/core/scraping/filters/text_filter.rb +34 -0
- data/lib/scrubyt/core/scraping/filters/tree_filter.rb +138 -0
- data/lib/scrubyt/core/scraping/pattern.rb +359 -0
- data/lib/scrubyt/core/scraping/pre_filter_document.rb +14 -0
- data/lib/scrubyt/core/scraping/result_indexer.rb +90 -0
- data/lib/scrubyt/core/shared/extractor.rb +171 -0
- data/lib/scrubyt/logging.rb +154 -0
- data/lib/scrubyt/output/post_processor.rb +139 -0
- data/lib/scrubyt/output/result.rb +44 -0
- data/lib/scrubyt/output/result_dumper.rb +154 -0
- data/lib/scrubyt/output/result_node.rb +145 -0
- data/lib/scrubyt/output/scrubyt_result.rb +42 -0
- data/lib/scrubyt/utils/compound_example_lookup.rb +50 -0
- data/lib/scrubyt/utils/ruby_extensions.rb +85 -0
- data/lib/scrubyt/utils/shared_utils.rb +58 -0
- data/lib/scrubyt/utils/simple_example_lookup.rb +40 -0
- data/lib/scrubyt/utils/xpathutils.rb +202 -0
- data/lib/scrubyt.rb +53 -0
- data/pkg/scrubyt-0.4.31.gem +0 -0
- data/resources/allison/LICENSE +184 -0
- data/resources/allison/README +37 -0
- data/resources/allison/allison.css +301 -0
- data/resources/allison/allison.gif +0 -0
- data/resources/allison/allison.js +307 -0
- data/resources/allison/allison.rb +287 -0
- data/resources/allison/cache/BODY +588 -0
- data/resources/allison/cache/CLASS_INDEX +4 -0
- data/resources/allison/cache/CLASS_PAGE +1 -0
- data/resources/allison/cache/FILE_INDEX +4 -0
- data/resources/allison/cache/FILE_PAGE +1 -0
- data/resources/allison/cache/FONTS +1 -0
- data/resources/allison/cache/FR_INDEX_BODY +1 -0
- data/resources/allison/cache/IMGPATH +1 -0
- data/resources/allison/cache/INDEX +1 -0
- data/resources/allison/cache/JAVASCRIPT +307 -0
- data/resources/allison/cache/METHOD_INDEX +4 -0
- data/resources/allison/cache/METHOD_LIST +1 -0
- data/resources/allison/cache/SRC_PAGE +1 -0
- data/resources/allison/cache/STYLE +323 -0
- data/resources/allison/cache/URL +1 -0
- data/scrubyt.gemspec +609 -0
- data/test/blackbox_test.rb +60 -0
- data/test/blackbox_tests/basic/multi_root.expected.xml +8 -0
- data/test/blackbox_tests/basic/multi_root.rb +6 -0
- data/test/blackbox_tests/basic/simple.expected.xml +5 -0
- data/test/blackbox_tests/basic/simple.rb +5 -0
- data/test/blackbox_tests/basic/three_divs.html +12 -0
- data/test/blackbox_tests/detail_page/detail_page_1.html +7 -0
- data/test/blackbox_tests/detail_page/detail_page_2.html +7 -0
- data/test/blackbox_tests/detail_page/main_page_1.html +5 -0
- data/test/blackbox_tests/detail_page/main_page_2.html +6 -0
- data/test/blackbox_tests/detail_page/one_detail_page.expected.xml +7 -0
- data/test/blackbox_tests/detail_page/one_detail_page.rb +9 -0
- data/test/blackbox_tests/detail_page/two_detail_pages.expected.xml +12 -0
- data/test/blackbox_tests/detail_page/two_detail_pages.rb +9 -0
- data/test/blackbox_tests/next_page/next_page_link.expected.xml +11 -0
- data/test/blackbox_tests/next_page/next_page_link.rb +7 -0
- data/test/blackbox_tests/next_page/page_1.html +11 -0
- data/test/blackbox_tests/next_page/page_2.html +11 -0
- data/test/blackbox_tests/next_page/page_3.html +7 -0
- data/test/blackbox_tests/next_page/page_list_links.expected.xml +11 -0
- data/test/blackbox_tests/next_page/page_list_links.rb +7 -0
- data/test/blackbox_tests/next_page/page_list_links.tofix +7 -0
- data/todo/backlog.txt +73 -0
- data/todo/scenario_ideas.txt +19 -0
- metadata +637 -0
@@ -0,0 +1,16 @@
|
|
1
|
+
$:.unshift File.join(File.dirname(__FILE__), '../../../lib')
|
2
|
+
|
3
|
+
require 'scrubyt'
|
4
|
+
|
5
|
+
event_data = Scrubyt::Extractor.define do
|
6
|
+
fetch File.join(File.dirname(__FILE__), "input.html")
|
7
|
+
|
8
|
+
event do
|
9
|
+
title 'Frühlingsgefühle'
|
10
|
+
begin_time '22.00'
|
11
|
+
admission_fee '4,00'
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
event_data.to_xml.write($stdout, 1)
|
16
|
+
Scrubyt::ResultDumper.print_statistics(event_data)
|
@@ -0,0 +1,14 @@
|
|
1
|
+
$:.unshift File.join(File.dirname(__FILE__), '../../../lib')
|
2
|
+
|
3
|
+
require 'scrubyt'
|
4
|
+
|
5
|
+
event_data = Scrubyt::Extractor.define do
|
6
|
+
fetch File.join(File.dirname(__FILE__), "input.html")
|
7
|
+
|
8
|
+
group do
|
9
|
+
e1 'f1'
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
event_data.to_xml.write($stdout, 1)
|
14
|
+
Scrubyt::ResultDumper.print_statistics(event_data)
|
@@ -0,0 +1,11 @@
|
|
1
|
+
$:.unshift File.join(File.dirname(__FILE__), '../../../..lib')
|
2
|
+
|
3
|
+
require 'scrubyt'
|
4
|
+
|
5
|
+
compo_data = Scrubyt::Extractor.define do
|
6
|
+
fetch(File.join(File.dirname(__FILE__),'tricky_compound.html'))
|
7
|
+
|
8
|
+
para({:contains => '4, 5, 6', :begins_with => '3', :ends_with => '6'}, :generalize => false)
|
9
|
+
end
|
10
|
+
|
11
|
+
compo_data.to_xml.write($stdout,1)
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<html>
|
2
|
+
<body>
|
3
|
+
<table>
|
4
|
+
<tr>
|
5
|
+
<td>
|
6
|
+
This is a phone number: 123-456-78. It's a dummy phone no.
|
7
|
+
</td>
|
8
|
+
<td>
|
9
|
+
Another dummy phone number: 111-222-333. Really dummy.
|
10
|
+
</td>
|
11
|
+
<td>
|
12
|
+
And for the users of scRUBYt!, yet another dumb fake-phone no: 111-111-111-111. Enough examples for now.
|
13
|
+
</td>
|
14
|
+
</tr>
|
15
|
+
</table>
|
16
|
+
</body>
|
17
|
+
</html>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
$:.unshift File.join(File.dirname(__FILE__), '../../../..lib')
|
2
|
+
|
3
|
+
require 'scrubyt'
|
4
|
+
|
5
|
+
compo_data = Scrubyt::Extractor.define do
|
6
|
+
fetch(File.join(File.dirname(__FILE__),'regexp_compound.html'))
|
7
|
+
|
8
|
+
para({:contains => /11\d+/}, :generalize => false)
|
9
|
+
end
|
10
|
+
|
11
|
+
compo_data.to_xml.write($stdout,1)
|
@@ -0,0 +1,11 @@
|
|
1
|
+
$:.unshift File.join(File.dirname(__FILE__), '../../../../lib')
|
2
|
+
|
3
|
+
require 'scrubyt'
|
4
|
+
|
5
|
+
compo_data = Scrubyt::Extractor.define do
|
6
|
+
fetch(File.join(File.dirname(__FILE__),'compound.html'))
|
7
|
+
|
8
|
+
para({:contains => 'said'}, :generalize => false)
|
9
|
+
end
|
10
|
+
|
11
|
+
compo_data.to_xml.write($stdout,1)
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<html>
|
2
|
+
<body>
|
3
|
+
<table style='border :1px solid black' cellpadding=2 cellspacing=2>
|
4
|
+
<tr><td>This is some text</td></tr>
|
5
|
+
<tr><td>This is some more nonsense text</td></tr>
|
6
|
+
<tr><td>And here is the detail link: <a href='detailpage.html'>detail link!</a></td></tr>
|
7
|
+
</table>
|
8
|
+
</body>
|
9
|
+
</html>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
$:.unshift File.join(File.dirname(__FILE__), '../../../lib')
|
2
|
+
|
3
|
+
require 'scrubyt'
|
4
|
+
|
5
|
+
result = Scrubyt::Extractor.define do
|
6
|
+
fetch 'index.html'
|
7
|
+
|
8
|
+
stuff 'detail link!' do
|
9
|
+
stuff_detail do
|
10
|
+
other_stuff 'Here is one detail paragraph!'
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
|
16
|
+
puts result.to_xml
|
17
|
+
result.export('test')
|
@@ -0,0 +1,39 @@
|
|
1
|
+
$:.unshift File.join(File.dirname(__FILE__), '../../../lib')
|
2
|
+
|
3
|
+
require 'scrubyt'
|
4
|
+
|
5
|
+
#The compulsory google example :)
|
6
|
+
#Don't you have the feeling that a google.com example in web programming
|
7
|
+
#is becoming something like 'Hello World' in desktop programming?
|
8
|
+
#
|
9
|
+
#Example of:
|
10
|
+
# - filling and submitting a textfield
|
11
|
+
# - using a href attribute
|
12
|
+
# - recursively crawling to the next page(s)
|
13
|
+
#
|
14
|
+
#Goal: Go to google.com. Enter 'ruby' into the search textfield and
|
15
|
+
# submit the form. Extract the url of the first 20 pages.
|
16
|
+
#Solution: Use the navigational commands 'fetch', 'fill_textfield', 'submit'
|
17
|
+
# to navigate to the page of interest. There, extract the links with
|
18
|
+
# the pattern 'link'. The URLs should be extracted with 'link''s child
|
19
|
+
# pattern, 'url' which is an attribute pattern.
|
20
|
+
# This will extract the first 10 results, but you need the first 20.
|
21
|
+
# To achieve this, the 'next_page' idiom should be used, with :limit set
|
22
|
+
# to 2.
|
23
|
+
|
24
|
+
google_data = Scrubyt::Extractor.define do
|
25
|
+
#Perform the action(s)
|
26
|
+
fetch 'http://www.google.com/ncr'
|
27
|
+
fill_textfield 'q', 'ruby'
|
28
|
+
submit
|
29
|
+
#Construct the wrapper
|
30
|
+
link "Ruby Programming Language" do
|
31
|
+
url "href", :type => :attribute
|
32
|
+
end
|
33
|
+
next_page "Next", :limit => 2
|
34
|
+
end
|
35
|
+
|
36
|
+
google_data.to_xml.write($stdout, 1)
|
37
|
+
Scrubyt::ResultDumper.print_statistics(google_data)
|
38
|
+
|
39
|
+
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require("rubygems")
|
2
|
+
require("scrubyt")
|
3
|
+
|
4
|
+
data = Scrubyt::Extractor.define do
|
5
|
+
fetch("input.html")
|
6
|
+
|
7
|
+
stuff("/html[1]/body[1]/table[1]/tr[2]/td[1]", { :generalize => false }) do
|
8
|
+
index("index", { :type => :attribute })
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
data.to_xml.write($stdout, 1)
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<html>
|
2
|
+
<body>
|
3
|
+
<table>
|
4
|
+
<tr>
|
5
|
+
<td index="1">Identical example</td>
|
6
|
+
<td index="2">Identical example</td>
|
7
|
+
</tr>
|
8
|
+
<tr>
|
9
|
+
<td index="3">Identical example</td>
|
10
|
+
<td index="4">Identical example</td>
|
11
|
+
</tr>
|
12
|
+
</table>
|
13
|
+
<p index="5">Identical example</p>
|
14
|
+
</body>
|
15
|
+
</html>
|
16
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
$: << File.join(File.dirname(__FILE__), '../../../lib')
|
2
|
+
require 'scrubyt'
|
3
|
+
include Scrubyt
|
4
|
+
|
5
|
+
data = Extractor.define do
|
6
|
+
fetch 'input.html'
|
7
|
+
|
8
|
+
stuff 'Identical example[2]', :generalize => false do
|
9
|
+
index 'index', :type => :attribute
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
|
14
|
+
data.to_xml.write($stdout,1)
|
15
|
+
data.export(__FILE__)
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<html>
|
2
|
+
<body>
|
3
|
+
<table>
|
4
|
+
<tr>
|
5
|
+
<td index="1">Identical example</td>
|
6
|
+
<td index="2">Identical example</td>
|
7
|
+
</tr>
|
8
|
+
<tr>
|
9
|
+
<td index="3">Identical example</td>
|
10
|
+
<td index="4">Identical example</td>
|
11
|
+
</tr>
|
12
|
+
</table>
|
13
|
+
<p index="5">Identical example</p>
|
14
|
+
</body>
|
15
|
+
</html>
|
16
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
$: << File.join(File.dirname(__FILE__), '../../../lib')
|
2
|
+
require 'scrubyt'
|
3
|
+
include Scrubyt
|
4
|
+
|
5
|
+
data = Extractor.define do
|
6
|
+
fetch 'input.html'
|
7
|
+
|
8
|
+
stuff 'Identical example/@index'#, :generalize => false
|
9
|
+
end
|
10
|
+
|
11
|
+
|
12
|
+
data.to_xml.write($stdout,1)
|
13
|
+
data.show_stats
|
14
|
+
data.export(__FILE__)
|
@@ -0,0 +1,22 @@
|
|
1
|
+
$:.unshift File.join(File.dirname(__FILE__), '../../../lib')
|
2
|
+
|
3
|
+
require 'scrubyt'
|
4
|
+
|
5
|
+
#Example of:
|
6
|
+
#Goal:
|
7
|
+
#Solution:
|
8
|
+
|
9
|
+
multiple_example_data = Scrubyt::Extractor.define do
|
10
|
+
fetch File.join(File.dirname(__FILE__), "input.html")
|
11
|
+
|
12
|
+
first_info 'However, we would like to match this paragraph, and also the following span: ' do
|
13
|
+
additional_info 'hi there!'
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
multiple_example_data.to_xml.write($stdout, 1)
|
18
|
+
multiple_example_data.export(__FILE__)
|
19
|
+
Scrubyt::ResultDumper.print_statistics(multiple_example_data)
|
20
|
+
|
21
|
+
|
22
|
+
|
@@ -0,0 +1,42 @@
|
|
1
|
+
$:.unshift File.join(File.dirname(__FILE__), '../../../lib')
|
2
|
+
|
3
|
+
require 'scrubyt'
|
4
|
+
require 'scrubyt/output/result_dumper'
|
5
|
+
|
6
|
+
#Example of: Using the next_page command with onclick='' hrefs.
|
7
|
+
|
8
|
+
### Doesn't work, as next_page doesn't click links
|
9
|
+
data = Scrubyt::Extractor.define(:agent => :firefox) do
|
10
|
+
fetch("file://"+File.expand_path(File.join(File.dirname(__FILE__), "page_1.html")))
|
11
|
+
|
12
|
+
entry '//div'
|
13
|
+
|
14
|
+
next_page 'Next'
|
15
|
+
end
|
16
|
+
|
17
|
+
puts "First results :"
|
18
|
+
puts data.to_xml
|
19
|
+
|
20
|
+
puts "---------------"
|
21
|
+
|
22
|
+
### Doesn't work, all the results are the same :(
|
23
|
+
|
24
|
+
data = Scrubyt::Extractor.define(:agent => :firefox) do
|
25
|
+
fetch("file://"+File.expand_path(File.join(File.dirname(__FILE__), "page_1.html")))
|
26
|
+
|
27
|
+
while(true)
|
28
|
+
entry '//div'
|
29
|
+
|
30
|
+
begin
|
31
|
+
click_link 'Next'
|
32
|
+
rescue Watir::Exception::UnknownObjectException
|
33
|
+
puts "Reached the end. Breaking"
|
34
|
+
break
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
puts "Second results:"
|
39
|
+
puts data.to_xml
|
40
|
+
|
41
|
+
|
42
|
+
|
@@ -0,0 +1,29 @@
|
|
1
|
+
$:.unshift File.join(File.dirname(__FILE__), '../../../lib')
|
2
|
+
|
3
|
+
require 'scrubyt'
|
4
|
+
|
5
|
+
#Example of: Collecting blog addresses from rubycorner.com
|
6
|
+
# - extracting href attribute from an <a> tag
|
7
|
+
# - crawling to all of the pages
|
8
|
+
#
|
9
|
+
#Goal: Go to http://rubycorner.com/blogs/lang/en. This listing
|
10
|
+
# contains all the English blogs aggregated by rubycorner.
|
11
|
+
# Scrape all of them!
|
12
|
+
#Solution: Extract all <a> patterns as you would normally. To further
|
13
|
+
# extract the href from the 'link' pattern, use an attrinute
|
14
|
+
# pattern (specified by :type => :attribute)
|
15
|
+
# Finally, crawl to all of the pages with next_page - this time
|
16
|
+
# without a limit since we need all the pages.
|
17
|
+
|
18
|
+
rubycorner_data = Scrubyt::Extractor.define do
|
19
|
+
#Perform the action(s)
|
20
|
+
fetch 'http://rubycorner.com/blogs/lang/en'
|
21
|
+
#Construct the wrapper
|
22
|
+
link "Boston BarCamp Day 1" do
|
23
|
+
url "href", :type => :attribute
|
24
|
+
end
|
25
|
+
next_page ">"
|
26
|
+
end
|
27
|
+
|
28
|
+
rubycorner_data.to_xml.write($stdout, 1)
|
29
|
+
Scrubyt::ResultDumper.print_statistics(rubycorner_data)
|
@@ -0,0 +1,30 @@
|
|
1
|
+
$:.unshift File.join(File.dirname(__FILE__), '../../../lib')
|
2
|
+
|
3
|
+
require 'scrubyt'
|
4
|
+
|
5
|
+
#Example of: - logging to an account - rubyforge.org this time
|
6
|
+
# - submitting the form with a button
|
7
|
+
#
|
8
|
+
#Goal: Go to 'http://rubyforge.org/' and login. Once you are inside,
|
9
|
+
# scrape something not really interesting just to show you are in!
|
10
|
+
#Solution: Go to rubyforge.org and click on the 'Log In' link. This gets you to the
|
11
|
+
# login page, where you fill in the appropriate textfields.
|
12
|
+
# Submitting the textfield once everything is setup up for the show is a bit
|
13
|
+
# different this time - since a simple form.submit does not work. You have
|
14
|
+
# to submit the form by pressing a button. The solution is to specify the index
|
15
|
+
# of the button which should be pressed.
|
16
|
+
|
17
|
+
rubyforge_data = Scrubyt::Extractor.define do
|
18
|
+
fetch 'http://rubyforge.org/'
|
19
|
+
click_link 'Log In'
|
20
|
+
fill_textfield 'form_loginname', '*login_here*'
|
21
|
+
fill_textfield 'form_pw', '*pass_here*'
|
22
|
+
submit 0
|
23
|
+
|
24
|
+
stuff 'My Personal Page'
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
rubyforge_data.to_xml.write($stdout, 1)
|
29
|
+
Scrubyt::ResultDumper.print_statistics(rubyforge_data)
|
30
|
+
|
@@ -0,0 +1,37 @@
|
|
1
|
+
$:.unshift File.join(File.dirname(__FILE__), '../../../../lib')
|
2
|
+
|
3
|
+
require 'scrubyt'
|
4
|
+
|
5
|
+
#Example of:
|
6
|
+
# - Sepecyfiing multiple examples
|
7
|
+
#
|
8
|
+
#Goal: From this simple table, scrape the languages and their rivals, into
|
9
|
+
# a structure like
|
10
|
+
#
|
11
|
+
# <language_war>
|
12
|
+
# <lang>Ruby</lang>
|
13
|
+
# <rival>Python</rival>
|
14
|
+
# </language_war>
|
15
|
+
#
|
16
|
+
# Try it as you would normally - i.e. just supply lang the example 'Ruby'
|
17
|
+
# and rival the example 'Python' and it won't work. This is because
|
18
|
+
# in the document, the other two semantically similar records (Java and
|
19
|
+
# C#) are contained at different places in the structure. This is a dummy
|
20
|
+
# example, but in the real life you have this with a lot of webshops
|
21
|
+
# and other pages as well.
|
22
|
+
#
|
23
|
+
#Solution: Specify multiple examples as in the example below - until you get
|
24
|
+
# everything you need (i.e. theoretically you can specify even
|
25
|
+
# 12345 examples, however that would be unmaintainable :-))
|
26
|
+
|
27
|
+
ambigous_data = Scrubyt::Extractor.define do
|
28
|
+
fetch File.join(File.dirname(__FILE__), "input.html")
|
29
|
+
#Construct the wrapper
|
30
|
+
language_war do
|
31
|
+
lang 'Ruby', 'Java'
|
32
|
+
rival 'Python', 'C#'
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
ambigous_data.to_xml.write($stdout, 1)
|
37
|
+
Scrubyt::ResultDumper.print_statistics(ambigous_data)
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<html>
|
2
|
+
<body>
|
3
|
+
<table border=1 padding=10>
|
4
|
+
<tr>
|
5
|
+
<td>1, 2, 3</td>
|
6
|
+
<td>Vancouver, Quebec</td>
|
7
|
+
</tr>
|
8
|
+
<tr>
|
9
|
+
<td>London and Vienna and Prague</td>
|
10
|
+
<td>1, Spam, 3, Ham</td>
|
11
|
+
<td>Just a simple text cell</td>
|
12
|
+
</tr>
|
13
|
+
</table>
|
14
|
+
</body>
|
15
|
+
</html>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
$:.unshift File.join(File.dirname(__FILE__), '../../../../lib')
|
2
|
+
|
3
|
+
require 'scrubyt'
|
4
|
+
|
5
|
+
#Example of:
|
6
|
+
# - using a regexp pattern
|
7
|
+
#
|
8
|
+
#Goal: Extract the numbers one by one from the pattern 'cell'
|
9
|
+
#Solution: Add a regexp pattern to the pattern 'cell'.
|
10
|
+
|
11
|
+
table_data = Scrubyt::Extractor.define do
|
12
|
+
#Perform the action(s)
|
13
|
+
fetch File.join(File.dirname(__FILE__), "input.html")
|
14
|
+
#Construct the wrapper
|
15
|
+
table do
|
16
|
+
row :generalize => true do
|
17
|
+
cell '1, 2, 3', :generalize => true do
|
18
|
+
numbers /\d+/
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
table_data.to_xml.write($stdout, 1)
|
25
|
+
Scrubyt::ResultDumper.print_statistics(table_data)
|
@@ -0,0 +1,45 @@
|
|
1
|
+
<html>
|
2
|
+
<body>
|
3
|
+
<table>
|
4
|
+
<tr>
|
5
|
+
<td>The Matrix</td>
|
6
|
+
<td>Neo</td>
|
7
|
+
</tr>
|
8
|
+
<tr>
|
9
|
+
<td>Star Wars</td>
|
10
|
+
<td>Luke Skywalker</td>
|
11
|
+
</tr>
|
12
|
+
<tr>
|
13
|
+
<td>Garfield</td>
|
14
|
+
</tr>
|
15
|
+
<tr>
|
16
|
+
<td>Saw</td>
|
17
|
+
<td>Jigsaw</td>
|
18
|
+
</tr>
|
19
|
+
<tr>
|
20
|
+
<td>Pirates of the Caribbean</td>
|
21
|
+
<td><b>Jack Sparrow<b></td>
|
22
|
+
</tr>
|
23
|
+
<tr>
|
24
|
+
<td>Pirates of the Amazonas</td>
|
25
|
+
</tr>
|
26
|
+
<tr></tr>
|
27
|
+
<tr><td>Starsky & Hutch</td></tr>
|
28
|
+
<tr><h1>The coolest stuff</h1>
|
29
|
+
<td>Test cell</td>
|
30
|
+
<td>
|
31
|
+
<table>
|
32
|
+
<tr>
|
33
|
+
<td>Kill Bill</td>
|
34
|
+
<td>The Bride</td>
|
35
|
+
</tr>
|
36
|
+
<tr>
|
37
|
+
<td>Kill Bill, vol 2.</td>
|
38
|
+
<td>Beatrix Kiddo</td>
|
39
|
+
</tr>
|
40
|
+
</table>
|
41
|
+
</td>
|
42
|
+
</tr>
|
43
|
+
</table>
|
44
|
+
</body>
|
45
|
+
</html>
|
@@ -0,0 +1,30 @@
|
|
1
|
+
$:.unshift File.join(File.dirname(__FILE__), '../../../../lib')
|
2
|
+
|
3
|
+
require 'scrubyt'
|
4
|
+
|
5
|
+
#Example of:
|
6
|
+
# - Sepecyfying multiple examples
|
7
|
+
# - Narrowig the results by requiring the presence of some patterns
|
8
|
+
#
|
9
|
+
#Goal: We want to extract all movies, containing their title and their
|
10
|
+
# main_character. Moreover, we need only those movies which
|
11
|
+
# have both the title and the main_character specified
|
12
|
+
#
|
13
|
+
#Solution: See the ambigous_records example on why to use multiple examples.
|
14
|
+
# Use the ensure_presence_of_pattern constraint to extract only
|
15
|
+
# those movies which have child patterns named 'title' and
|
16
|
+
# 'main_character'
|
17
|
+
|
18
|
+
table_data_comp = Scrubyt::Extractor.define do
|
19
|
+
#Perform the action(s)
|
20
|
+
fetch File.join(File.dirname(__FILE__), "input.html")
|
21
|
+
#Construct the wrapper
|
22
|
+
movie do
|
23
|
+
title 'The Matrix', 'Kill Bill'
|
24
|
+
main_character 'Neo', 'The Bride'
|
25
|
+
end.ensure_presence_of_pattern('title').
|
26
|
+
ensure_presence_of_pattern('main_character')
|
27
|
+
end
|
28
|
+
|
29
|
+
table_data_comp.to_xml.write($stdout, 1)
|
30
|
+
Scrubyt::ResultDumper.print_statistics(table_data_comp)
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<html>
|
2
|
+
<body>
|
3
|
+
<table border=1 padding=10>
|
4
|
+
<tr>
|
5
|
+
<td>1</td>
|
6
|
+
<td>2</td>
|
7
|
+
<td>3</td>
|
8
|
+
<td>4</td>
|
9
|
+
<td>5</td>
|
10
|
+
<td>6</td>
|
11
|
+
<td>7</td>
|
12
|
+
<td>8</td>
|
13
|
+
<td>9</td>
|
14
|
+
<td>10</td>
|
15
|
+
<td>11</td>
|
16
|
+
<td>12</td>
|
17
|
+
</tr>
|
18
|
+
</table>
|
19
|
+
</body>
|
20
|
+
</html>
|