selenium

How to perform multiple actions and click on the link with text as Member Login on the url http://www.spicejet.com/ through selenium-webdriver

旧街凉风 提交于 2021-02-02 03:43:23
问题 I tried the below code but it is not mouse hovering and clicking on 'Member login' WebElement lgn = driver.findElement(By.id("ctl00_HyperLinkLogin")); WebElement ssm = driver.findElement(By.xpath("//a[contains(text(), 'SpiceCash/SpiceClub Members')]")); WebElement cgm = driver.findElement(By.xpath("//a[contains(text(),'Member Login')]")); Actions a1 = new Actions(driver); a1.moveToElement(lgn).moveToElement(ssm).moveToElement(cgm).click().build().perform(); 回答1: To invoke click() on the

Selenium Webdriver can't access a website (The requested URL was rejected)

烂漫一生 提交于 2021-02-02 03:43:06
问题 I did several hours of research and asked a bunch of people on fiverr who all couldn't solve a a specific problem I have. I installed Selenium and tried to access a Website. Unfortunately the site won't allow a specific request and doesn't load the site at all. However, if I try to access the website with my "normal" Chrome Browser, it works fine. I tried several things such as: Different IP's Deleting Cookies Incognito Mode Adding different UserAgents Hiding features which might reveal that

用最简单的编程语言,做最实用的自动化测试

浪尽此生 提交于 2021-02-01 07:23:16
霍格沃兹测试学院 最近,“Python将纳入高考”的消息,狠狠地刷爆了朋友圈。尽管这则消息目前还未得到官方的确认,但Python早已经为编程界所推崇。当前人工智能/数据挖掘/机器学习大量的使用Python,Python的需求逐渐增加,而且Python语言经过简单的学习就可以编写一些具有使用功能的小工具,提高日常工作学习的效率,让工作、生活变得更加美好! 霍格沃兹测试学院&TesterHome社区 联手推出python selenium自动化测试课程,把企业的真实需求和我们的强大技术实力完美结合,我们专为手工测试工程师、初级自动化测试工程师精心设计了此课程。 本课程主要围绕selenium在Web测试中的应用展开介绍,重点讲解自动化基础、编写selenium用例、框架原理、项目实战,此外还介绍多用例管理与维护、jekins持续集成和python、selenium面试题讲解,旨在帮助学员学会web自动化测试的整个工作流程,融合起来,应用到日常工作中去。 讲师介绍 方程无解,10年+自主研发自动化测试工具经验,其CSDN博客专栏《用Python做测试》是测试类访问量最大的专栏,擅长用Python开发自动化测试工具和模拟器。 课程亮点 Python基础+Python测试开发实战,突出流程和实战的重要性 技术点全面,体系完善,重点突出 讲师是技术经验极雄厚的大牛,技术博客十年笔耕不缀

Element not Interactable when using the selenium function find element by name but works when using find element by xpath method

*爱你&永不变心* 提交于 2021-02-01 05:14:57
问题 I have webpage where I am trying to login to it. When I use find element by name method to find the elements I get element not interactable error but when i use find element by xpath it works fine and no error. Can anyone explain me why it is not able to interact with element when found by name method? Same issue is observed for User ID, Password and Login elements. I am sure even when using by name method website is loaded and is ready for use. Below is the screenshot of the Webpage login My

Element not Interactable when using the selenium function find element by name but works when using find element by xpath method

杀马特。学长 韩版系。学妹 提交于 2021-02-01 05:14:46
问题 I have webpage where I am trying to login to it. When I use find element by name method to find the elements I get element not interactable error but when i use find element by xpath it works fine and no error. Can anyone explain me why it is not able to interact with element when found by name method? Same issue is observed for User ID, Password and Login elements. I am sure even when using by name method website is loaded and is ready for use. Below is the screenshot of the Webpage login My

Element not Interactable when using the selenium function find element by name but works when using find element by xpath method

限于喜欢 提交于 2021-02-01 05:14:18
问题 I have webpage where I am trying to login to it. When I use find element by name method to find the elements I get element not interactable error but when i use find element by xpath it works fine and no error. Can anyone explain me why it is not able to interact with element when found by name method? Same issue is observed for User ID, Password and Login elements. I am sure even when using by name method website is loaded and is ready for use. Below is the screenshot of the Webpage login My

python/selenium/chromedriver TimeoutException

你离开我真会死。 提交于 2021-02-01 05:14:04
问题 I'm in the process of scraping pdfs from a website using selenium and chrome webdriver. I use the following, pulling the site from a list: driver.get(site) source = driver.page_source ... ... driver.quit() But I keep getting the following error, about 6,000 observations down my site list: Traceback (most recent call last): File "<stdin>", line 127, in <module> File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 323, in get self.execute(Command.GET, {'url

python/selenium/chromedriver TimeoutException

无人久伴 提交于 2021-02-01 05:13:51
问题 I'm in the process of scraping pdfs from a website using selenium and chrome webdriver. I use the following, pulling the site from a list: driver.get(site) source = driver.page_source ... ... driver.quit() But I keep getting the following error, about 6,000 observations down my site list: Traceback (most recent call last): File "<stdin>", line 127, in <module> File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 323, in get self.execute(Command.GET, {'url

python/selenium/chromedriver TimeoutException

£可爱£侵袭症+ 提交于 2021-02-01 05:13:23
问题 I'm in the process of scraping pdfs from a website using selenium and chrome webdriver. I use the following, pulling the site from a list: driver.get(site) source = driver.page_source ... ... driver.quit() But I keep getting the following error, about 6,000 observations down my site list: Traceback (most recent call last): File "<stdin>", line 127, in <module> File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 323, in get self.execute(Command.GET, {'url

selenium对js的执行操作——selenium控制浏览器页面的滚动

冷暖自知 提交于 2021-01-31 13:33:52
调用JavaScript代码 虽然WebDriver提供了操作浏览器的前进和后退方法,但对于浏览器滚动条并没有提供相应的操作方法。在这种情况下,就可以借助JavaScript来控制浏览器的滚动条。WebDriver提供了execute_script()方法来执行JavaScript代码。 用于调整浏览器滚动条位置的JavaScript代码如下: window.scrollTo(0,450); window.scrollTo()方法用于设置浏览器窗口滚动条的水平和垂直位置。方法的第一个参数表示水平的左间距,第二个参数表示垂直的上边距。其代码如下: from selenium import webdriver import time url = ' https://www.hao123.com/ ' driver = webdriver.Firefox() driver.get(url) for i in range(100 ): # 滚动到固定位置 js = ' window.scrollTo(0,%s) ' %(100* i) # 滚动到距离顶部指定长度 # js = "var q=document.documentElement.scrollTop=%s"%(100*i) driver.execute_script(js) time.sleep( 0.1 ) time.sleep