我正在使用 Selenium 和 Python 从我们的发电厂自动提取一些数据,现在我需要单击一个元素。问题是xpaths我们正在监控的每个工厂的元素和顺序都发生了变化。唯一的静态信息是value,就像在第三行中一样value="T_U0。
我尝试了很多方法,但找不到解决方案。我不能使用 index 或 child 因为参数的顺序正在改变。我尝试了 CSS 选择器但没有成功。
在这里你可以得到我的一些尝试......
driver.find_element_by_xpath("//input[@value='T_U0']").click()
driver.find_element_by_css_selector("input[@data-id-sys-abbreviation='388']").click()
Run Code Online (Sandbox Code Playgroud)
我尝试了很多其他的东西,但我只是拼命地尝试任何东西。
我真正需要的是一个find_by_value,如果有办法做到这一点,请告诉我,如果没有,请告诉我如何去做。
我想在某些语言中做:
(A1 != A2 != A3)
Run Code Online (Sandbox Code Playgroud)
是一样的:
(A1 != A2 or A1!= A3 or A3 != A2)
Run Code Online (Sandbox Code Playgroud)
在Oracle中也是如此吗?或者,有没有其他方法可以实现这一点,而不是重复?
当我运行以下代码时,它会给出一个分段错误:
#include <stdio.h>
int main() {
int i;
char char_array[5] = {'a', 'b', 'c', 'd', 'e'};
int int_array[5] = {1, 2, 3, 4, 5};
unsigned int hacky_nonpointer;
hacky_nonpointer = (unsigned int) char_array;
for(i=0; i < 5; i++) { // Iterate through the int array with the int_pointer.
printf("[hacky_nonpointer] points to %p, which contains the char '%c'\n",
hacky_nonpointer, *((char *) hacky_nonpointer));
hacky_nonpointer = hacky_nonpointer + sizeof(char);
}
hacky_nonpointer = (unsigned int) int_array;
for(i=0; i < 5; i++) { // Iterate through …Run Code Online (Sandbox Code Playgroud)