Comments (4)
Fixed it in the above commit, and renamed them to FindNextElementSibling()
and FindPrevElementSibling()
I'll be implementing the actual FindNextSibling()
and FindPrevSibling()
in the upcoming commits.
from soup.
Thanks for reporting it. I'll try to fix it as soon as possible.
from soup.
I think the fix d325696 does not work because it is r.Pointer.NextSibling
might be nil, and calling .NextSibling
on it causing the nil pointer dereference crash/panic.
Maybe try this:
func (r Root) FindNextSibling() Node {
nextSibling := r.Pointer.NextSibling
if nextSibling == nil {
log.Fatal("No next sibling found")
}
// try to find next element-node?
if nextSibling.Type == html.ElementNode {
return Root{nextSibling}
} else {
// keep looking
}
}
from soup.
Ah, I see it now. I'll make the fixes accordingly.
from soup.
Related Issues (20)
- In the examples file weather.go element not found HOT 1
- go.mod: no matching versions for query "v1.2" HOT 3
- FindAll Regex HOT 1
- How to use selectors? HOT 1
- How can I find with class and get attribute? HOT 2
- Find Or HOT 2
- Find() ret Root field value Pointer maybe nil HOT 1
- Anything akin to BeautifulSoup's Comment? HOT 1
- Navigating to Parent HOT 2
- How to get http status code? HOT 1
- InnerHTML
- fatal error: concurrent map iteration and map write HOT 1
- findOnce break after the first child node.
- Is this possible to search by some attribute? HOT 1
- soup.HTMLParse() returning nil
- Should Text() return all sibling text?
- i found a bug in your soup
- Can anyone tell me how to send request through proxy? HOT 2
- how to set proxy with get request?
- invalid memory address or nil pointer dereference when chaining methods HOT 2
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 soup.