zugangsdaten werden vom main durchgeschleift
This commit is contained in:
@@ -18,15 +18,25 @@ namespace CardmarketBot
|
||||
{
|
||||
class CardMarketParser
|
||||
{
|
||||
private readonly string username;
|
||||
private readonly string password;
|
||||
|
||||
Dictionary<string, Helper.Porto> portoberechnung = new Dictionary<string, Helper.Porto>()
|
||||
{
|
||||
{"1,15 €", Helper.Porto.BRIEF085 },
|
||||
{"1,30 €", Helper.Porto.BRIEF100 },
|
||||
{"2,10 €", Helper.Porto.BRIEF160 },
|
||||
{"3,25 €", Helper.Porto.BRIEF275 },
|
||||
{"2,60 €", Helper.Porto.PRIO210 },
|
||||
{"3,20 €", Helper.Porto.PRIO270 },
|
||||
{"1,15 €", Helper.Porto.BRIEF085 },
|
||||
{"1,30 €", Helper.Porto.BRIEF100 },
|
||||
{"2,10 €", Helper.Porto.BRIEF160 },
|
||||
{"3,25 €", Helper.Porto.BRIEF275 },
|
||||
{"2,60 €", Helper.Porto.PRIO210 },
|
||||
{"3,20 €", Helper.Porto.PRIO270 },
|
||||
};
|
||||
|
||||
public CardMarketParser(string username, string password)
|
||||
{
|
||||
this.username = username;
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public List<Kunde> ParseCardMarket()
|
||||
{
|
||||
ChromeOptions options = new ChromeOptions();
|
||||
@@ -35,13 +45,15 @@ namespace CardmarketBot
|
||||
cd.Url = @"https://www.cardmarket.com/de/OnePiece";
|
||||
|
||||
cd.Navigate();
|
||||
|
||||
cd.FindElement(By.CssSelector("#CookiesConsent > div > div > form > button")).Click();
|
||||
Thread.Sleep(10);
|
||||
cd.FindElement(By.Name("username")).Click();
|
||||
cd.FindElement(By.Name("username")).SendKeys("Skywalkerex");
|
||||
cd.FindElement(By.Name("username")).SendKeys(username);
|
||||
|
||||
cd.FindElement(By.Name("userPassword")).Click();
|
||||
|
||||
|
||||
cd.FindElement(By.Name("userPassword")).SendKeys("Magnatpower310!!");
|
||||
cd.FindElement(By.Name("userPassword")).SendKeys(password);
|
||||
|
||||
cd.FindElement(By.CssSelector("#header-login > input.btn.AB-login-btn.btn-outline-primary.btn-sm")).Click();
|
||||
|
||||
|
||||
@@ -74,7 +86,6 @@ namespace CardmarketBot
|
||||
foreach (string id in ids)
|
||||
{
|
||||
if (counter > maxCounter) break;
|
||||
Thread.Sleep(TimeSpan.FromSeconds(5));
|
||||
Console.WriteLine(id);
|
||||
cd.Navigate().GoToUrl(string.Format(@"https://www.cardmarket.com/de/OnePiece/Orders/{0}", id));
|
||||
element = cd.FindElement(By.XPath("/html/body/main/section/div/div[1]/div/div[3]/div[2]/div[2]/div/div"));
|
||||
@@ -101,6 +112,7 @@ namespace CardmarketBot
|
||||
|
||||
kunden.Add(kunde);
|
||||
counter++;
|
||||
Thread.Sleep(TimeSpan.FromSeconds(5));
|
||||
}
|
||||
return kunden;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user