Skip to content

Commit

Permalink
fix: removes timeouts and adds debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertYoung committed Oct 26, 2022
1 parent 8237fb0 commit bf776fb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cmd/manutd-ticket-checker/event-detail-page.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type UnitedEventDetailPage struct {
}

func (p *UnitedEventDetailPage) FindMinAndMaxPrices() (uint16, uint16) {
price_input, err := p.Timeout(5 * time.Second).Element(".areas-filter-panel__price-section input[type=number]")
price_input, err := p.Element(".areas-filter-panel__price-section input[type=number]")

if err != nil {
return 0, 0
Expand Down
7 changes: 6 additions & 1 deletion cmd/manutd-ticket-checker/event-item.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package mutc
import (
"errors"
"fmt"
"log"
"strings"
"time"

Expand Down Expand Up @@ -108,7 +109,11 @@ func (e *UnitedEventItem) IsPremierLeagueEvent() bool {
}

func (e *UnitedEventItem) BuyButton() (*rod.Element, error) {
return e.Timeout(5 * time.Second).Element("div.addToBasket > a")
log.Printf("finding buy button for %s", e.Name())
button, err := e.Element.Element("div.addToBasket > a")
log.Printf("found buy button for %s", e.Name())

return button, err
}

func (e *UnitedEventItem) LoadEventDetailPage(event *UnitedEventItem) error {
Expand Down
6 changes: 2 additions & 4 deletions cmd/manutd-ticket-checker/page.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package mutc

import (
"time"

"github.com/go-rod/rod"
)

Expand All @@ -11,13 +9,13 @@ type UnitedPage struct {
}

func (c *UnitedPage) DeleteCookieOverlay() {
tint_overlay, err := c.Timeout(5 * time.Second).Element("#tint-overlay")
tint_overlay, err := c.Element("#tint-overlay")

if err == nil {
tint_overlay.Remove()
}

cookie_messages, err := c.Timeout(5 * time.Second).Element("#cookie-messages")
cookie_messages, err := c.Element("#cookie-messages")

if err == nil {
cookie_messages.Remove()
Expand Down

0 comments on commit bf776fb

Please sign in to comment.