Programm erweitert
über bestellnummer angabe prüft der Bot die Bestellung
This commit is contained in:
@@ -29,7 +29,7 @@ namespace CardmarketBot
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public List<Kunde> ParseCardMarket()
|
||||
public List<Kunde> ParseCardMarket(string forceid = "")
|
||||
{
|
||||
ChromeOptions options = new ChromeOptions();
|
||||
options.AddArgument("start-maximized");
|
||||
@@ -61,40 +61,40 @@ namespace CardmarketBot
|
||||
cookieContainer.Add(new System.Net.Cookie(name, value, c.Path, c.Domain));
|
||||
}
|
||||
|
||||
cd.Navigate().GoToUrl(@"https://www.cardmarket.com/de/OnePiece/Orders/Sales/Paid");
|
||||
//cd.Navigate().GoToUrl(@"https://www.cardmarket.com/de/OnePiece/Orders/Sales/Sent");
|
||||
|
||||
List<string> ids = new List<string>();
|
||||
List<Kunde> kunden = new List<Kunde>();
|
||||
|
||||
IWebElement element;
|
||||
try
|
||||
|
||||
if (forceid != "")
|
||||
{
|
||||
element = cd.FindElement(By.XPath("/html/body/main/section/div[3]/div[4]"));
|
||||
|
||||
string content = element.Text;
|
||||
|
||||
|
||||
string[] datas = content.Split("\r\n");
|
||||
|
||||
|
||||
for (int i = 8; i < datas.Length; i += 7)
|
||||
{
|
||||
ids.Add(datas[i]);
|
||||
}
|
||||
ids.Add(forceid);
|
||||
}
|
||||
catch(OpenQA.Selenium.NotFoundException)
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Keine Verkäufe aktuell");
|
||||
return kunden;
|
||||
cd.Navigate().GoToUrl(@"https://www.cardmarket.com/de/OnePiece/Orders/Sales/Paid");
|
||||
|
||||
try
|
||||
{
|
||||
element = cd.FindElement(By.XPath("/html/body/main/section/div[3]/div[4]"));
|
||||
|
||||
string content = element.Text;
|
||||
string[] datas = content.Split("\r\n");
|
||||
|
||||
for (int i = 8; i < datas.Length; i += 7)
|
||||
{
|
||||
ids.Add(datas[i]);
|
||||
}
|
||||
}
|
||||
catch (OpenQA.Selenium.NotFoundException)
|
||||
{
|
||||
Console.WriteLine("Keine Verkäufe aktuell");
|
||||
return kunden;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (string id in ids)
|
||||
{
|
||||
//if (id != "1121844928") continue;
|
||||
//Console.WriteLine(id);
|
||||
//id = "1121395158";
|
||||
//cd.Navigate().GoToUrl(string.Format(@"https://www.cardmarket.com/de/OnePiece/Orders/1121395158", 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"));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user