Hey I need to scrape an html for a specific shipping rate here's the HTML:
<ul class="methods" id="shipping-quotes" data-url="/en/webshipper/setshippingquote" data-shipping-fee="£ 12">
<li class="method-option method-option--shipping">
<div class="method-option__header">
<input
id="shippingrate-8"
name="shippingrate"
type="radio"
value="8"
class="method-option__input shipping-rate"
/>
<label for="shippingrate-8" class="method-option__label">
<span class="method-option__name">UPS Standard UK - Home Delivery (2-4 business days)</span>
<span class="method-option__fee">9 GBP</span>
</label>
</div>
</li>
<li class="method-option method-option--shipping">
<div class="method-option__header">
<input
id="shippingrate-9"
name="shippingrate"
type="radio"
value="9"
class="method-option__input shipping-rate"
/>
<label for="shippingrate-9" class="method-option__label">
<span class="method-option__name">UPS Standard UK - Pick-up Point (2-4 business days)</span>
<span class="method-option__fee">6 GBP</span>
</label>
</div>
</li>
<li class="method-option method-option--shipping">
<div class="method-option__header">
<input
id="shippingrate-15"
name="shippingrate"
type="radio"
value="15"
class="method-option__input shipping-rate"
/>
<label for="shippingrate-15" class="method-option__label">
<span class="method-option__name">UPS Express UK - Home Delivery (2-4 business days)</span>
<span class="method-option__fee">15 GBP</span>
</label>
</div>
</li>
<li class="method-option method-option--shipping">
<div class="method-option__header">
<input
id="shippingrate-29"
name="shippingrate"
type="radio"
value="29"
class="method-option__input shipping-rate"
checked
/>
<label for="shippingrate-29" class="method-option__label">
<span class="method-option__name">UPS Express UK - Pick-up Point (1-3 business days)</span>
<span class="method-option__fee">12 GBP</span>
</label>
</div>
<div class="drop-points" id="drop-points">
<p class="drop-point drop-point--no-result">
No pickup points found near your chosen location
</p>
</div>
</li>
</ul>
Specifically the home delivery option so in the HTML below I would need to get the value= 9 value so I would like to get the value of 9. How could I get the specific value for the home delivery option using bs4?
If I am unclear i mean the value option within this
<input
id="shippingrate-9"
name="shippingrate"
type="radio"
value="9"
class="method-option__input shipping-rate"
/>
For the home delivery 2-4 days option.
soup.find('input', {'name': 'shippingrate'}).attrs['value'].soup.find_alland a loop. You need to read the docs as you seem to lack the basics and are trying to run before you can walk.