开发者

Using Include? in Celerity Screen Scraping Script

开发者 https://www.devze.com 2023-01-31 19:09 出处:网络
I am using to Celerity to screen scrape a web page and I\'m attempting to scrape all of the text elements within a particular div class.The following line of开发者_如何学Go code I\'m using is throwing

I am using to Celerity to screen scrape a web page and I'm attempting to scrape all of the text elements within a particular div class. The following line of开发者_如何学Go code I'm using is throwing the following error: wrong argument type String (expected Module) (TypeError)

Code: puts browser.text if browser.frame(:id, 'bottomframe').div.class.include? 'ClassName'

Can anyone tell me what this error means or more importantly how to fix my line of code.


Further review of the Celerity documentation has provided a solution to my question.

Celerity provides the ability to use Regular Expressions to specify what you would like to find/match on the particular web page. For example: browser.link(:text, /ish/) means the first element that matches the regular expression /ish/.

Thanks

0

精彩评论

暂无评论...
验证码 换一张
取 消