
Product
Introducing Socket Fix for Safe, Automated Dependency Upgrades
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
A simple crawling utility for Ruby.
This project enables site crawling and data extraction with xpath and css selectors. You can also send forms such as text data, files, and checkboxes.
name | Description |
---|---|
send | Set the value you want to submit to the form. |
submit | Submit form. |
css | Get node by css selector. |
xpath | Get node by xpath. |
attr | Get node's attribute. |
inner_text | Get node's inner text. |
require 'husc'
url = 'http://www.example.com/'
doc = Husc.new(url)
# access another url
doc.get('another url')
# get current url
doc.url
# get current site's html
doc.html
# get <table> tags as dict
doc.tables
# search for nodes by css selector
# tag : css('name')
# class : css('.name')
# id : css('#name')
doc.css('div')
doc.css('.main-text')
doc.css('#tadjs')
# search for nodes by xpath
doc.xpath('//*[@id="top"]/div[1]')
# other example
doc.css('div').css('a')[2].attr('href') # => string object
doc.css('p').inner_text() # => string object
# You do not need to specify "[]" to access the first index
# login
doc.send(id:'id attribute', value:'value to send')
doc.send(id:'id attribute', value:'value to send')
doc.submit(id:'id attribute') # submit
# post file
doc.send(id:'id attribute', file_name:'target file name')
# checkbox
doc.send(id:'id attribute', check:true) # check
doc.send(id:'id attribute', check:false) # uncheck
# button click
doc.send(id:'id attribute', click:true) # click
doc.send(id:'id attribute', click:false) # unclick
# example of specify other attribute
doc.send(name:'name attribute', value:'hello')
doc.send(class:'class attribute', value:100)
$ gem install husc
Bug reports and pull requests are welcome on GitHub at https://github.com/AjxLab/husc.
FAQs
Unknown package
We found that husc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
Security News
CISA denies CVE funding issues amid backlash over a new CVE foundation formed by board members, raising concerns about transparency and program governance.
Product
We’re excited to announce a powerful new capability in Socket: historical data and enhanced analytics.