Closed lf2a closed 2 years ago
Describe the bug Error when get_element_coords() is called. https://github.com/botcity-dev/botcity-framework-web-python/blob/1b7d79faa907faaebd3682c4c82f082899c69278/botcity/web/bot.py#L767
get_element_coords()
Expected behavior Get coords.
Steps to Reproduce
import os from botcity.web import WebBot, Browser, By project_path = os.path.abspath('') web = WebBot() web.headless = False web.browser = Browser.FIREFOX web.driver_path = os.path.join(project_path, 'web-drivers', 'geckodriver.exe') web.browse('https://google.com') try: web.add_image('google', os.path.join('resources', 'google-logo.png')) web.get_element_coords('google') finally: web.stop_browser()
Traceback (most recent call last): File "D:\BotCity\dev\web-test\web.py", line 22, in <module> web.get_element_coords('git') File "D:\BotCity\dev\web-test\venv\lib\site-packages\botcity\web\bot.py", line 743, in get_element_coords it = cv2find.locate_all_opencv(self.state.map_images[label], region=region, confidence=matching) TypeError: locate_all_opencv() missing 1 required positional argument: 'haystack_image' Process finished with exit code 1
Possible Solution Add haystack = self.get_screen_image() and change cv2find.locate_all_opencv(self.state.map_images[label], region=region, confidence=matching) to cv2find.locate_all_opencv(self.state.map_images[label], haystack_image=haystack, region=region, confidence=matching)
haystack = self.get_screen_image()
cv2find.locate_all_opencv(self.state.map_images[label], region=region, confidence=matching)
cv2find.locate_all_opencv(self.state.map_images[label], haystack_image=haystack, region=region, confidence=matching)
haystack = self.get_screen_image() it = cv2find.locate_all_opencv(self.state.map_images[label], haystack_image=haystack, region=region, confidence=matching)
My Platform
botcity-framework-web=0.3.1
Closed via #32
Describe the bug Error when
get_element_coords()
is called. https://github.com/botcity-dev/botcity-framework-web-python/blob/1b7d79faa907faaebd3682c4c82f082899c69278/botcity/web/bot.py#L767Expected behavior Get coords.
Steps to Reproduce
Possible Solution Add
haystack = self.get_screen_image()
and changecv2find.locate_all_opencv(self.state.map_images[label], region=region, confidence=matching)
tocv2find.locate_all_opencv(self.state.map_images[label], haystack_image=haystack, region=region, confidence=matching)
My Platform
botcity-framework-web=0.3.1