我正在使用:
https://github.com/TheBigBrainsCompany/TbbcMoneyBundle
当我用:
启动时def getPremeProduct() -> str:
session = requests.Session()
base = "http://www.supremenewyork.com"
r = session.get('http://www.supremenewyork.com/shop/all/accessories')
soup = BeautifulSoup(r.content, 'lxml')
keyword = input('Input your keyword: ')
color = str(input('input your color: '))
productColor = soup.findAll('p', text=re.compile(r'\bChecker\b'))
productName = soup.findAll('a', text=re.compile(r'\bTees\b'))
if "Checker" in productName:
print(productName)
### Here are the outputs for productName
#<a class="name-link" href="/shop/accessories/s4o3fjcg0/eq35gubw7">Supreme®/Hanes® Checker Tagless Tees (2 Pack)</a>
#<a class="name-link" href="/shop/accessories/hz7wj2ui4/jx7qm1hsc">Supreme®/Hanes® Tagless Tees (3 Pack)</a>
#<a class="name-link" href="/shop/accessories/hz7wj2ui4/yks6zay73">Supreme®/Hanes® Tagless Tees (3 Pack)</a>
我在 Crawler.php第565行中看到错误:
bin/console tbbc:money:ratio-fetch
请有人帮助我吗?
答案 0 :(得分:0)
找到解决方案
需要在文件\ vendor \ tbbc \ money-bundle \ Tbbc \ MoneyBundle \ Pair \ RatioProvider \ GoogleRatioProvider.php
中替换protected function getEndpoint($units, Currency $referenceCurrency, Currency $currency)
{
//https://finance.google.com/finance/converter
return sprintf(
'https://finance.google.com/bctzjpnsun/converter?a=%s&from=%s&to=%s',
$units,
$referenceCurrency->getCode(),
$currency->getCode()
);
}