@@ -1347,7 +1347,6 @@ def get_partial_link_text_attribute(
1347
1347
1348
1348
def click_link_text(self, link_text, timeout=None):
1349
1349
"""This method clicks link text on a page."""
1350
- # If using phantomjs, might need to extract and open the link directly
1351
1350
self.__check_scope()
1352
1351
if not timeout:
1353
1352
timeout = settings.SMALL_TIMEOUT
@@ -1356,15 +1355,6 @@ def click_link_text(self, link_text, timeout=None):
1356
1355
pre_action_url = self.driver.current_url
1357
1356
pre_window_count = len(self.driver.window_handles)
1358
1357
link_text = self.__get_type_checked_text(link_text)
1359
- if self.browser == "phantomjs":
1360
- if self.is_link_text_visible(link_text):
1361
- element = self.wait_for_link_text_visible(
1362
- link_text, timeout=timeout
1363
- )
1364
- element.click()
1365
- return
1366
- self.open(self.__get_href_from_link_text(link_text))
1367
- return
1368
1358
if self.browser == "safari":
1369
1359
if self.demo_mode:
1370
1360
self.wait_for_link_text_present(link_text, timeout=timeout)
@@ -1481,45 +1471,12 @@ def click_link_text(self, link_text, timeout=None):
1481
1471
1482
1472
def click_partial_link_text(self, partial_link_text, timeout=None):
1483
1473
"""This method clicks the partial link text on a page."""
1484
- # If using phantomjs, might need to extract and open the link directly
1485
1474
self.__check_scope()
1486
1475
if not timeout:
1487
1476
timeout = settings.SMALL_TIMEOUT
1488
1477
if self.timeout_multiplier and timeout == settings.SMALL_TIMEOUT:
1489
1478
timeout = self.__get_new_timeout(timeout)
1490
1479
partial_link_text = self.__get_type_checked_text(partial_link_text)
1491
- if self.browser == "phantomjs":
1492
- if self.is_partial_link_text_visible(partial_link_text):
1493
- element = self.wait_for_partial_link_text(partial_link_text)
1494
- if not self.undetectable or self.__uc_frame_layer > 0:
1495
- element.click()
1496
- else:
1497
- element.uc_click()
1498
- return
1499
- soup = self.get_beautiful_soup()
1500
- html_links = soup.fetch("a")
1501
- for html_link in html_links:
1502
- if partial_link_text in html_link.text:
1503
- for html_attribute in html_link.attrs:
1504
- if html_attribute[0] == "href":
1505
- href = html_attribute[1]
1506
- if href.startswith("//"):
1507
- link = "http:" + href
1508
- elif href.startswith("/"):
1509
- url = self.driver.current_url
1510
- domain_url = self.get_domain_url(url)
1511
- link = domain_url + href
1512
- else:
1513
- link = href
1514
- self.open(link)
1515
- return
1516
- raise Exception(
1517
- "Could not parse link from partial link_text "
1518
- "{%s}" % partial_link_text
1519
- )
1520
- raise Exception(
1521
- "Partial link text {%s} was not found!" % partial_link_text
1522
- )
1523
1480
if not self.is_partial_link_text_present(partial_link_text):
1524
1481
self.wait_for_partial_link_text_present(
1525
1482
partial_link_text, timeout=timeout
0 commit comments