Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/330.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/clojure/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用python和selenium单击日历中的日期_Python_Selenium_Calendar - Fatal编程技术网

使用python和selenium单击日历中的日期

使用python和selenium单击日历中的日期,python,selenium,calendar,Python,Selenium,Calendar,我很难弄清楚如何使用Python和Selenium在日历中单击开始和停止日期。下面是日历的HTML代码和它的屏幕截图。在日历中,首先选择开始日期,然后选择结束日期,并突出显示其间的所有内容 6 2020年7月 开始日期 2020年7月 您可以分享日历的url吗?这样我就可以浏览更多内容了。跟随这个链接它将帮助你我不能共享URL这不是一个公共网站,我使用的是Python而不是Java编程语言。当你做自动化时,试试我在pythoncan中的方法。你可以为日历共享你的URL,这样我可以了解更多。跟随

我很难弄清楚如何使用Python和Selenium在日历中单击开始和停止日期。下面是日历的HTML代码和它的屏幕截图。在日历中,首先选择开始日期,然后选择结束日期,并突出显示其间的所有内容

6
2020年7月
开始日期

2020年7月
您可以分享日历的url吗?这样我就可以浏览更多内容了。跟随这个链接它将帮助你我不能共享URL这不是一个公共网站,我使用的是Python而不是Java编程语言。当你做自动化时,试试我在pythoncan中的方法。你可以为日历共享你的URL,这样我可以了解更多。跟随这个链接它将帮助你我不能共享URL这不是一个公共网站,我使用的是Python而不是Java编程语言,当你做自动化时,试试我在Python中的方法你能添加正确的html吗?将代码和html粘贴为图像不是一个好的做法,它很难调试并找到准确的解决方案。对此我很抱歉,您可以添加适当的html吗?将代码和html粘贴为图像不是一个好的做法,调试和找到准确的解决方案非常困难。对此我很抱歉
<td class="day ng-binding ng-scope" ng-repeat="day in week" ng-class="{
        'now':isNow(day),
        'active':isSameDay(day),
        'disabled':(day.getMonth()!=date.getMonth() || isDayDisabled(day)),
        'after':isAfter(day),
        'before':isBefore(day)
      }" ng-click="setDate(day)" ng-bind="day.getDate()">6</td>

<th colspan="5" class="switch ng-binding" ng-click="setView('month')">2020 July</th>

<p class="cndrTitle ng-binding">Start Date</p>

<th colspan="5" class="switch ng-binding" ng-click="setView('month')">2020 July</th>
    public static void setcalender(String monthyear2, String date2,String monthyear3, String date3) {
        // driver.findElement(By.id("xpath of month  year")).click();

       

        while (true) {
            String CurrentMonth = driver.findElement(By.xpath("xpath of title]")).getText();
            if (CurrentMonth.equals(monthyear2)) {
                break;
            } else {

// click next arrow option until get user input 
                driver.findElement(By.xpath("xpath")).click();
            }
        }
       
        driver.findElement(By.linkText(date2)).click();
            }

    //click on thru date title
        driver.findElement(By.id("xpath")).click();
        

        while (true) {
            String CurrentMonth = driver.findElement(By.xpath("your xpath]")).getText();
            if (CurrentMonth.equals(monthyear3)) {
                break;
            } else {
// click next arrow until get date
                driver.findElement(By.xpath("xpath)).click();
            }
        }
        
        driver.findElement(By.linkText(date3)).click();
       
    
    }