From 4549a14714cdc5f34288625dc68f3a5c9cdc5409 Mon Sep 17 00:00:00 2001 From: Barbara Ericson Date: Fri, 8 Nov 2024 08:46:43 -0500 Subject: [PATCH] Fix to BSoup stuff --- _sources/bsoup/writecode.rst | 4 ++-- _sources/bsoup/writecode_mu.rst | 6 +++--- _sources/bsoup/writecode_orig.rst | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/_sources/bsoup/writecode.rst b/_sources/bsoup/writecode.rst index 8428561c..e70d9f8a 100644 --- a/_sources/bsoup/writecode.rst +++ b/_sources/bsoup/writecode.rst @@ -1,8 +1,8 @@ Write Code Questions ------------------------ -.. selectquestion:: bsoup_writecode_1_sq_v2 - :fromid: bsoup_writecode1q_v2, bsoup_writecode1q_mu +.. selectquestion:: bsoup_writecode_1_sq_v3 + :fromid: bsoup_writecode1q_v3, bsoup_writecode1q_mu_v2 :toggle: lock .. selectquestion:: bsoup_writecode_2_sq_v2 diff --git a/_sources/bsoup/writecode_mu.rst b/_sources/bsoup/writecode_mu.rst index 18e5e273..fa9b9b24 100644 --- a/_sources/bsoup/writecode_mu.rst +++ b/_sources/bsoup/writecode_mu.rst @@ -1,7 +1,7 @@ Write Code Questions --------------------- -.. parsonsprob:: bsoup_writecode1q_mu +.. parsonsprob:: bsoup_writecode1q_mu_v2 :numbered: left :practice: T :adaptive: @@ -19,9 +19,9 @@ Write Code Questions ===== soup = BeautifulSoup(r.text, 'html.parser') ===== - text = soup.find('a', text = "Current Students") + text = soup.find('a', string = "Current Students") ===== - text = soup.find_all('a', text = "Current Students") #paired + text = soup.find_all('a', string = "Current Students") #paired ===== info = text.get('href') ===== diff --git a/_sources/bsoup/writecode_orig.rst b/_sources/bsoup/writecode_orig.rst index 55fcde7a..5a020993 100644 --- a/_sources/bsoup/writecode_orig.rst +++ b/_sources/bsoup/writecode_orig.rst @@ -1,11 +1,11 @@ Write Code Questions --------------------- #. - .. tabbed:: bsoup_writecode1_v2 + .. tabbed:: bsoup_writecode1_v3 .. tab:: Question - .. activecode:: bsoup_writecode1q_v2 + .. activecode:: bsoup_writecode1q_v3 :practice: T :nocodelens: :language: python3 @@ -30,7 +30,7 @@ Write Code Questions soup = BeautifulSoup(r.text, 'html.parser') # inspect Current Students to get the details - text = soup.find('a', text = "Current Students") + text = soup.find('a', string = "Current Students") info = text.get('href') all_info = "https://umich.edu" + info return all_info