How to get the HTML source of a webpage in Ruby
来源:互联网 发布:mac qq截图不能用 编辑:程序博客网 时间:2024/06/06 00:20
Use Net::HTTP:
require 'net/http'
source = Net::HTTP.get('stackoverflow.com', '/index.html')
require 'open-uri'source = open(url){|f|f.read}
UPD: more modern syntax
require 'open-uri'source = open(url, &:read)
require 'open-uri'source = open(url).read
0 0
- How to get the HTML source of a webpage in Ruby
- How to Get the Frequency Table of a Categorical Variable as a Data Frame in R
- ORA-30926: unable to get a stable set of rows in the source tables
- ORA-30926: unable to get a stable set of rows in the source tables
- ORA-30926: unable to get a stable set of rows in the source tables
- uiview 某点返回 色值 How to get the color of a pixel in an UIView?
- 得到坐标的颜色值 How to get the color of a pixel in an UIView?
- use grep & awk to get ed2k links in the webpage
- How to get the source code of the chromium of the specified revision
- How to Get a List of Class Attributes in Python
- How to get the field descriptions of a table?
- How to get the field descriptions of a table
- ORACLE MERGE INTO语句,unable to get a stable set of rows in the source tables报错解决
- How to: Access the HTML Source in the Managed HTML Document Object Model
- How to use the pointer of function in a class?
- How to find number of a specific integer in an array of Fixnums ruby
- How to Get Source Code of a Linux Command on CentOS
- How to get information of .a/.so
- 为Ubuntu安装翻译词典(星际译王)
- 【Codeforces】Codeforces Round #271 div2
- 学习篇----数组和指针
- Caused by: Unable to load bean: type: class:com.opensymphony.xwork2.ObjectFactory - bean - jar
- ubuntu eclipse CDT 问题
- How to get the HTML source of a webpage in Ruby
- Struts2应用在断网的情况下启动报错: java/net/AbstractPlainSocketImpl.java:178:-1解决
- D. Flowers Codeforces Round #271(div2)
- (1)Android 4.4 Launcher3桌面源码分析
- Spring的IOC和DI
- RS简单报表遇到的问题1
- (2)android触摸事件处理流程
- 函数指针用法
- Android中Intent传递对象的两种方法(Serializable,Parcelable)