Css-селекторы обычно быстрее, чем xpath. Вы можете использовать следующее:
from bs4 import BeautifulSoup as bs
html = '''
<div class="product-info-price">
<div class="price-box price-final_price" data-role="priceBox" data-product-
id="32686" data-price-box="product-id-32686">
<span class="special-price">
<span class="price-container price-final_price tax weee" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<span class="price-label">Ειδική Τιμή</span>
<span id="product-price-32686" data-price-amount="7.9" data-price-type="finalPrice" class="price-wrapper " >
<span class="price">7,90 €</span>
</span>
<meta itemprop="price" content="7.9" />
<meta itemprop="priceCurrency" content="EUR" />
</span>
</span>
</div>
</div>
'''
soup = bs(html, 'lxml')
prices = [price.text for price in soup.select('.price')]
print(prices)
В качестве альтернативы:
altPrices = [price['content'] for price in soup.select("[itemprop=price]")]
print(altPrices)
Это трудно сказать, не зная специфических особенностей, но здесь является a DataGridTextColumn
это центрируется:
<wpf:DataGridTextColumn Header="Name" Binding="{Binding Name}" IsReadOnly="True">
<wpf:DataGridTextColumn.CellStyle>
<Style>
<Setter Property="FrameworkElement.HorizontalAlignment" Value="Center"/>
</Style>
</wpf:DataGridTextColumn.CellStyle>
</wpf:DataGridTextColumn>
Хорошо, я использовал подход frameworkElement, но при попытке выделить строку было странное поведение.
Я поместил еще один пример выравнивания WPF Datagrid в этот поток !
Если вы используете DataGridTextColumn, вы можете использовать следующий фрагмент кода:
<Style TargetType="DataGridCell">
<Style.Setters>
<Setter Property="TextBlock.TextAlignment" Value="Center" />
</Style.Setters>
</Style>