Skip to content

Commit

Permalink
fix puppeteer
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticroentgen committed Jun 3, 2024
1 parent be47ea8 commit 5a922c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions NotionWebsitePuppeteer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ bool FirstLoginStep()
IWebElement loginInput = _driver.FindElement(By.Id("notion-email-input-2"));
loginInput.SendKeys(_username);

IWebElement nextBtn = _driver.FindElement(By.XPath("//form/div[contains(text(), 'Continue')]"));
IWebElement nextBtn = _driver.FindElement(By.XPath("//form//div[contains(text(), 'Continue')]"));
nextBtn.Click();

Console.WriteLine("\tSleep 10sec");
Expand All @@ -78,7 +78,7 @@ bool FirstLoginStep()
try
{
IWebElement loginCodeBtn =
_driver.FindElement(By.XPath("//form/div[contains(text(), 'Continue with login code')]"));
_driver.FindElement(By.XPath("//form//div[contains(text(), 'Continue with login code')]"));
if (loginCodeBtn != null)
{
needsLoginCode = true;
Expand Down Expand Up @@ -133,7 +133,7 @@ bool FirstLoginStep()
passInput.SendKeys(_password);

Console.WriteLine("\tSending login...");
IWebElement loginBtn = _driver.FindElement(By.XPath("//form/div[contains(text(), 'Continue with password')]"));
IWebElement loginBtn = _driver.FindElement(By.XPath("//form//div[contains(text(), 'Continue with password')]"));
loginBtn.Click();
}
catch
Expand Down
1 change: 1 addition & 0 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ async Task<Cookie> FileCookie()
if (!response.IsSuccessStatusCode)
{
Console.WriteLine($"Unable to initiate download: [{response.StatusCode}] {response.ReasonPhrase}");
continue;
}

string datetime = DateTime.UtcNow.ToString("s").Replace(':', '-');
Expand Down

0 comments on commit 5a922c4

Please sign in to comment.