试图使用简单的对话框输入信息,但它不允许我使用我在对话框中输入的fieldValue
。Python无法输入字段值作为字符串
错误如下消息:
driver.get("https://" + fieldValues + "/test/")
TypeError: cannot concatenate 'str' and 'tuple' objects
脚本如下:
import re
import easygui
from pprint import pprint
from selenium import webdriver
from pyvirtualdisplay import Display
from selenium.webdriver.common.keys import Keys
msg = "Please enter the server to test...",
title = "Local Server Tester ",
fieldNames = ['Server URL'],
fieldValues = [], # we start with blanks for the values
fieldValues = easygui.multenterbox(msg,title, fieldNames),
# Get server from fieldValues
print ("Server to test", (fieldValues))
# Log into system
driver = webdriver.Chrome()
driver.get("https://" + fieldValues + "/test")
尝试'''.join(list(fieldValues))' – farhawa
'fieldValues'里面有什么和你想要的? –
Inside fieldValues将会被输入到对话框中,例如'google.com' – Grimlockz