Diff
diff --git a/main.go b/main.go
index e90cbe6..0c7b800 100644
--- a/main.go
+++ b/main.go
@@ -6,0 +7,2 @@ import (
+
+ "github.com/go-shiori/dom"
@@ -10,5 +12,2 @@ func main() {
- css := cstyle.CSS{
- Width: 1920,
- Height: 1080,
- }
- css.StyleSheet("./master.css")
+ css := cstyle.CSS{}
+ // css.StyleSheet("./master.css")
@@ -16 +15 @@ func main() {
- d := document.Write("./src/index.html")
+ d := document.Parse("./src/index.html")
@@ -26 +25,4 @@ func main() {
- // fmt.Printf("%s\n", css.StyleSheets)
+ fmt.Printf("%s\n", css.StyleSheets)
+
+ // Example selector: div#test > h1
+ selector := "div#test > h1"
@@ -28 +30,2 @@ func main() {
- p := css.Map(d.DOM)
+ // Use querySelectorAll to find elements that match the selector
+ matchingElements := dom.QuerySelectorAll(d.DOM, selector)
@@ -30,3 +33,5 @@ func main() {
- for k, v := range p.StyleMap {
- fmt.Printf("%s\n", k)
- fmt.Printf("%s\n", v)
+ fmt.Printf("%s\n", matchingElements)
+
+ // Print the matching elements
+ for _, elem := range matchingElements {
+ fmt.Printf("Match: <%s>\n", elem.Data)
@@ -33,0 +39 @@ func main() {
+