pearlxcore / Shopee-Autobuy-Bot

Automation program to assist users with purchasing products on the Shopee website.
55 stars 30 forks source link

Unable to Cart Checkout based on specific price #29

Closed Banana-97 closed 8 months ago

Banana-97 commented 8 months ago

Current element : CartTotalPriceLabel (//div[contains(@class, 'WC0us+)]) An error occurred on line at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse, String commandToExecute) at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary2 parameters) at OpenQA.Selenium.WebDriver.FindElement(String mechanism, String value) at OpenQA.Selenium.By.<.ctor>b__11_0(ISearchContext context) at OpenQA.Selenium.By.FindElement(ISearchContext context) at OpenQA.Selenium.WebDriver.FindElement(By by) at SeleniumExtras.WaitHelpers.ExpectedConditions.<>c__DisplayClass6_0.<ElementExists>b__0(IWebDriver driver) at OpenQA.Selenium.Support.UI.DefaultWait1.Until[TResult](Func2 condition, CancellationToken token) at OpenQA.Selenium.Support.UI.DefaultWait1.Until[TResult](Func`2 condition) at Shopee_Autobuy_Bot.SeleniumService.WaitElementExists(By locator) at Shopee_Autobuy_Bot.Services.AutoBuyService.CartPage_GetPrice() at Shopee_Autobuy_Bot.Services.AutoBuyService.HandleCartCheckoutPriceSpecific(String pageUrl) at Shopee_Autobuy_Bot.Services.AutoBuyService.CartPage(String buyMode): invalid selector: Unable to locate an element with the xpath expression //div[contains(@class, 'WC0us+)] because of the following error: SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//div[contains(@class, 'WC0us+)]' is not a valid XPath expression. (Session info: chrome=118.0.5993.118)

Banana-97 commented 8 months ago

I found the issue,

Given code on element.setting "CartTotalPriceLabel": "//div[contains(@class, 'WC0us+)]" Need to change to //div[contains(@class, 'WC0us+')]