0
0
Agentic_aiml~10 mins

Autonomous web browsing agents in Agentic Ai - Interactive Code Practice

Choose your learning style8 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a simple autonomous web browsing agent that opens a webpage.

Agentic_ai
agent = AutonomousAgent()
agent.[1]('https://example.com')
Drag options to blanks, or click blank then click option'
Arefresh_page
Bopen_url
Cclose_tab
Dclick_button
Attempts:
3 left
2fill in blank
medium

Complete the code to make the agent click a button identified by its CSS selector.

Agentic_ai
agent.open_url('https://example.com')
agent.[1]('#submit-button')
Drag options to blanks, or click blank then click option'
Await_for_load
Btype_text
Cscroll_down
Dclick_element
Attempts:
3 left
3fill in blank
hard

Fix the error in the code to correctly extract text from a page element.

Agentic_ai
text = agent.get_element_text([1])
Drag options to blanks, or click blank then click option'
A['#main-title']
Bmain-title
C'#main-title'
Dmain_title
Attempts:
3 left
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps element IDs to their text content.

Agentic_ai
texts = {id: agent.get_element_text([1]) for id in ids if agent.element_exists([2])}
Drag options to blanks, or click blank then click option'
A'#' + id
Bid
C'#' + id.lower()
D'#' + str(id)
Attempts:
3 left
5fill in blank
hard

Fill all three blanks to filter links, extract their URLs, and store them in a list.

Agentic_ai
links = [agent.get_element_attribute([1], [2]) for [3] in agent.find_elements('a') if agent.element_exists([1])]
Drag options to blanks, or click blank then click option'
Alink
B'href'
Cl
D'src'
Attempts:
3 left