1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-12-09 22:41:43 +02:00

Feature/#33 wait class function (#63)

* #33 Lib cleanup. Added WAIT_CLASS and WAIT_CLASS_ALL functions

* #33 Fixed attr update

* #33 HTMLElement.WaitForClass

* #33 Updated HTMLDocument.WaitForClass
This commit is contained in:
Tim Voronov
2018-10-06 22:33:39 -04:00
committed by GitHub
parent 79b8171fd8
commit e64ad4ec0e
48 changed files with 1193 additions and 670 deletions

View File

@@ -28,7 +28,8 @@ func NewDriver(setters ...Option) *Driver {
return &Driver{client}
}
func (d *Driver) GetDocument(_ context.Context, url string) (values.HTMLNode, error) {
func (d *Driver) GetDocument(_ context.Context, targetURL values.String) (values.HTMLNode, error) {
url := targetURL.String()
req, err := httpx.NewRequest(httpx.MethodGet, url, nil)
if err != nil {
@@ -58,7 +59,7 @@ func (d *Driver) GetDocument(_ context.Context, url string) (values.HTMLNode, er
return NewHTMLDocument(url, doc)
}
func (d *Driver) ParseDocument(_ context.Context, str string) (values.HTMLNode, error) {
func (d *Driver) ParseDocument(_ context.Context, str values.String) (values.HTMLNode, error) {
buf := bytes.NewBuffer([]byte(str))
doc, err := goquery.NewDocumentFromReader(buf)