Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/334.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/8/selenium/4.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 硒不吸收特定元素_Python_Selenium - Fatal编程技术网

Python 硒不吸收特定元素

Python 硒不吸收特定元素,python,selenium,Python,Selenium,所以我试着把这页上所有的药片都拿出来: 所有面板都有类名“row-row-search”,但它们不会保存到panels变量中。当它试图保存它们时没有出现错误,它只是继续。当它命中循环时,它表示它超出索引范围。当我打印变量面板时,它没有任何内容 感谢您的时间:)class=“row-row-search”表示元素有两个类(“row”和“row-search”)。请尝试: panels=find\u elements\u by\u class\u name(“行搜索”)class=“row-row

所以我试着把这页上所有的药片都拿出来:

所有面板都有类名“row-row-search”,但它们不会保存到panels变量中。当它试图保存它们时没有出现错误,它只是继续。当它命中循环时,它表示它超出索引范围。当我打印变量面板时,它没有任何内容

感谢您的时间:)

class=“row-row-search”表示元素有两个类(“row”和“row-search”)。请尝试:


panels=find\u elements\u by\u class\u name(“行搜索”)

class=“row-row-search”意味着元素有两个类(行和行搜索)。尝试:panels=find\u elements\u by\u class\u name(“行搜索”)已经起作用了!谢谢:)@Braca:你可能想把这个添加到答案中,这样Blake就可以接受它了,这个查询就结束了。
if msg.content.startswith(";pill"):
    pill = msg.content[5:]

    browser.get("https://pillreports.net/index.php?page=region_home&region=3&sub_region=28")
    panels = browser.find_elements_by_class_name("row row-search")
    print(panels)

    try:

        for i in range(0,15):
            print(i)
            search = panels[i].find_element_by_class_name("top_pad").text

            if search.lower == pill.lower:
                panels[i].click()
                break

    except NoSuchElementException:

        await bot.send_message(msg.channel, "Pinga not found dard")
        return