html-parser

Method to parse HTML document in Ruby?

笑着哭i 提交于 2019-11-26 09:49:55
问题 like DOMDocument class in PHP, is there any class in RUBY (i.e the core RUBY), to parse and get node elements value from a HTML Document. 回答1: There is no built-in HTML parser (yet), but some very good ones are available, in particular Nokogiri. Meta-answer: For common needs like these, I'd recommend checking out the Ruby Toolbox site. You'll notice that Nokogiri is the top recommendation for HTML parsers 回答2: You should check out hpricot. It's exceedingly good. It's not 'core' ruby, but it's

Scrape web page data generated by javascript

牧云@^-^@ 提交于 2019-11-26 02:25:24
问题 My question is: How to scrape data from this website http://vtis.vn/index.aspx But the data is not shown until you click on for example \"Danh sách chậm\". I have tried very hard and carefully, when you click on \"Danh sách chậm\" this is onclick event which triggers some javascript functions one of the js functions is to get the data from the server and insert it to a tag/place holder and at this point you can use something like firefox to examine the data and yes, the data is display to