@Controller.action(description='Get attribute and url of the page')
async def get_attr_url(self, browser: BrowserSession):
page = await browser.get_current_page()
current_url = page.url
some_attribute = await page.get_by_text('swwg labs').get_attribute('class')
print(current_url)
return ActionResult(extracted_content = f'The current URL is {current_url} and the attribute is {some_attribute}')
< /code>
Я называю их следующим образом: < /p>
controller = await Controller(output_model=CheckoutResults) //CheckoutResults-its another class.
< /code>
Я пробовал два разных способа с теми же результатами. Пожалуйста, помогите. < /p>
1. class Controller:
@Controller.action(description='Get attribute and url of the page')
async def get_attr_url(self, browser: BrowserSession):
page = await browser.get_current_page()
current_url = page.url
some_attribute = await page.get_by_text('swwg labs').get_attribute('class')
print(current_url)
return ActionResult(extracted_content = f'The current URL is {current_url} and the attribute is {some_attribute}')
2. class Controller:
@staticmethod
@Controller.action(description='Get attribute and url of the page')
async def get_attr_url(self, browser: BrowserSession):
page = await browser.get_current_page()
current_url = page.url
some_attribute = await page.get_by_text('swwg labs').get_attribute('class')
print(current_url)
return ActionResult(extracted_content = f'The current URL is {current_url} and the attribute is {some_attribute}')
< /code>
Для всех я получаю одинаковые результаты: < /p>
TypeError: Controller.action() missing 1 required positional argument: 'self'
У меня есть агент ИИ, для которого я написал контроллер, используя Python 3.13 и Playwright. < /p> [code]@Controller.action(description='Get attribute and url of the page') async def get_attr_url(self, browser: BrowserSession): page = await browser.get_current_page() current_url = page.url some_attribute = await page.get_by_text('swwg labs').get_attribute('class') print(current_url) return ActionResult(extracted_content = f'The current URL is {current_url} and the attribute is {some_attribute}') < /code> Я называю их следующим образом: < /p> controller = await Controller(output_model=CheckoutResults) //CheckoutResults-its another class. < /code> Я пробовал два разных способа с теми же результатами. Пожалуйста, помогите. < /p> 1. class Controller: @Controller.action(description='Get attribute and url of the page') async def get_attr_url(self, browser: BrowserSession): page = await browser.get_current_page() current_url = page.url some_attribute = await page.get_by_text('swwg labs').get_attribute('class') print(current_url) return ActionResult(extracted_content = f'The current URL is {current_url} and the attribute is {some_attribute}')
2. class Controller: @staticmethod @Controller.action(description='Get attribute and url of the page') async def get_attr_url(self, browser: BrowserSession): page = await browser.get_current_page() current_url = page.url some_attribute = await page.get_by_text('swwg labs').get_attribute('class') print(current_url) return ActionResult(extracted_content = f'The current URL is {current_url} and the attribute is {some_attribute}') < /code> Для всех я получаю одинаковые результаты: < /p> TypeError: Controller.action() missing 1 required positional argument: 'self' [/code] Спасибо
Я начал изучать извести. Когда я использую интерпретацию Limetabular Form, я сталкиваюсь с проблемой, в которой я в соответствии со стандартом выполняю функцию, но она не работает.
Ошибка - TypeError: init () отсутствует 1 требуемый позиционирование...
Я пытаюсь сделать свою домашнюю работу по объектно-ориентированному программированию, но я получаю странную ошибку.
Пробовал перезагрузить VSCODE или изменение имен. Система управления сотрудниками, которая демонстрирует множественное наследование,...
def fish_model():
model = Sequential()
from keras.layers import Activation, Dense
from keras.layers.convolutional import Convolution2D
from keras.layers.convolutional import MaxPooling2D
from keras.layers import...
Я пытаюсь загрузить версию терминала Anaconda3 для 64 -битной Mac OS Catalina для использования для Python 3.7, и я продолжаю столкнуться с ошибкой:
Unpacking payload ...
concurrent.futures.process._RemoteTraceback:
'''
Traceback (most recent call...