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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user