I guess that Monthy Python is very popular here but, programming in Python isn't.
Quick overview of what I want to do.
I want to program a script that will open the web browser and do a few clicks, read what's on the page, depending on the result, either do more clicks or click next.
So, I use MyFitnessPal. A pain each week to copy last week's breakfasts one by one. Monday to Sunday, I don't have the same meals but each Monday is the same meal.
So I would want to make a script that will load the food diary, and check if there's food logged in the breakfast first (0 calories in the breakfast section should do). Then do a copy from the date and pick last Monday if I'm on Monday. The same goes with the snacks then move to the next day and do it again. I would do a loop like that for 2-3 weeks so it's easier. Increasing or decreasing the loop after should be fairly easy.
I was able to make Selenium work with Python. I'm able to open the web browser on the food diary page. I started looking at tutorials and most seem to use xPath to find their elements in the webpage. I'm having issues finding them.
I got a kid's book at the public library as an introduction to Python. So, I'm doing that right now and I'm printing a lot of Hello World!
There might be an easier way to program it by using a URL that I would feed the web browser using the dates as parameters but I'm not able to make it work. Some variables must be initialized in MyFitnessPal and my Java knowledge is null.
So, any trick on finding those xPath ? Is it a plugin that I need to install so that I can right-click -> xPath?
Quick overview of what I want to do.
I want to program a script that will open the web browser and do a few clicks, read what's on the page, depending on the result, either do more clicks or click next.
So, I use MyFitnessPal. A pain each week to copy last week's breakfasts one by one. Monday to Sunday, I don't have the same meals but each Monday is the same meal.
So I would want to make a script that will load the food diary, and check if there's food logged in the breakfast first (0 calories in the breakfast section should do). Then do a copy from the date and pick last Monday if I'm on Monday. The same goes with the snacks then move to the next day and do it again. I would do a loop like that for 2-3 weeks so it's easier. Increasing or decreasing the loop after should be fairly easy.
I was able to make Selenium work with Python. I'm able to open the web browser on the food diary page. I started looking at tutorials and most seem to use xPath to find their elements in the webpage. I'm having issues finding them.
I got a kid's book at the public library as an introduction to Python. So, I'm doing that right now and I'm printing a lot of Hello World!
There might be an easier way to program it by using a URL that I would feed the web browser using the dates as parameters but I'm not able to make it work. Some variables must be initialized in MyFitnessPal and my Java knowledge is null.
So, any trick on finding those xPath ? Is it a plugin that I need to install so that I can right-click -> xPath?