Comments (7)
Open it with a reader. Untested code, but something like this:
f, e := os.Open("somefile.html")
if e != nil {
log.Fatal(e)
}
defer f.Close()
if doc, e = goquery.NewDocumentFromReader(f); e != nil {
log.Fatal(e)
}
from goquery.
Thanks, though it gives:
./goquery_try.go:26: undefined: goquery.NewDocumentFromReader
from goquery.
Do you have the latest goquery? https://godoc.org/github.com/PuerkitoBio/goquery#NewDocumentFromReader
from goquery.
@wfreeman Right, yeah, seems like I don't. I did go get github.com/PurekitoBio/goquery ... which version does that give me?
Will try checking out manually!
from goquery.
go get -u github.com/PuerkitoBio/goquery
will update it.
from goquery.
@wfreeman Indeed, awesome! Must have had some old version lurking around on disk (saw I had starred the repo before) but forgotten it, and thought I got the newest one when go getting it today.
Now it works perfect, thanks for the super-quick help!
from goquery.
thanks @wfreeman !
from goquery.
Related Issues (20)
- can't find nodes!
- QueryParams in links are encoded incorrectly HOT 1
- GoQuery Not Matching Element HOT 2
- How to count the number of words before and after a selection across a document? HOT 2
- If an id attribute contains dots tag will not be found HOT 2
- Find(selector)??????
- I am sorry, i can't find. May be some error. HOT 1
- Cant parse <tr> without <table> element. HOT 2
- how to get text 'CZ/KHN' HOT 3
- :first :first-child test failed,the expected nodes are not filtered out HOT 1
- Good
- How to query a shadow DOM? HOT 3
- Add a generic form of `Selection.Map` (requiring a more recent Go version) HOT 4
- Question about parsing nested tables and finding outer elements HOT 5
- Release Request for Current HEAD of golang.org/x/net with Security Updates HOT 5
- v1 (2).json
- Как добавить "github.com/PuerkitoBio/goquery" в свой код в визуал студио коде? HOT 1
- помогите с установкой GOPATH И GOROOT HOT 1
- Fails to remove some img elements HOT 2
- Has anyone ever tried goquery in a webbrowser with wasm?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from goquery.