Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Punch fix #63

Merged
merged 3 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def validEmail(email: str) -> bool:

def executeBot(currentAccount, notifier: Notifier, args: argparse.Namespace):
logging.info(
f'********************{ currentAccount.get("username", "") }********************'
f'********************{currentAccount.get("username", "")}********************'
)
accountPointsCounter = 0
remainingSearches = 0
Expand Down
10 changes: 6 additions & 4 deletions src/punchCards.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ def completePunchCard(self, url: str, childPromotions: dict):
for child in childPromotions:
if child["complete"] is False:
if child["promotionType"] == "urlreward":
# Click on offer CTA and visit new tab for URL rewards
self.webdriver.find_element(By.CLASS_NAME, "offer-cta").click()
self.webdriver.find_element(
By.XPATH, "//a[@class='offer-cta']/div"
).click()
self.browser.utils.visitNewTab(random.randint(13, 17))
if child["promotionType"] == "quiz":
# Click on offer CTA and complete quiz in a new tab
self.webdriver.find_element(By.CLASS_NAME, "offer-cta").click()
self.webdriver.find_element(
By.XPATH, "//a[@class='offer-cta']/div"
).click()
self.browser.utils.switchToNewTab(8)
counter = str(
self.webdriver.find_element(
Expand Down
1 change: 1 addition & 0 deletions src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ def getRemainingSearches(self):
dashboard = self.getDashboardData()
searchPoints = 1
counters = dashboard["userStatus"]["counters"]

if "pcSearch" not in counters:
return 0, 0

Expand Down