File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -1552,13 +1552,24 @@ def ad_block(self):
1552
1552
except Exception :
1553
1553
pass # Don't fail test if ad_blocking fails
1554
1554
1555
+ @decorators .deprecated ("Use re.escape() instead! It does what you want!" )
1555
1556
def jq_format (self , code ):
1556
- # DEPRECATED - Use re.escape() instead, which does the action you want.
1557
+ # DEPRECATED - re.escape() already does that thing you want!
1557
1558
return js_utils ._jq_format (code )
1558
1559
1559
1560
def get_domain_url (self , url ):
1560
1561
return page_utils .get_domain_url (url )
1561
1562
1563
+ def get_beautiful_soup (self , source = None ):
1564
+ """ BeautifulSoup is a toolkit for dissecting an HTML document
1565
+ and extracting what you need. It's great for screen-scraping! """
1566
+ from bs4 import BeautifulSoup
1567
+ if not source :
1568
+ self .wait_for_ready_state_complete ()
1569
+ source = self .get_page_source ()
1570
+ soup = BeautifulSoup (source , "html.parser" )
1571
+ return soup
1572
+
1562
1573
def safe_execute_script (self , script ):
1563
1574
""" When executing a script that contains a jQuery command,
1564
1575
it's important that the jQuery library has been loaded first.
You can’t perform that action at this time.
0 commit comments