如何转动已抓取的数据点23FLAT
soup = BeautifulSoup(response, 'html.parser')
datapoint_one = soup.findAll(class_ = 'kinfobox').text
just_number = float(datapoint_one.strip('FLAT'))
print(just_number)
.. 23
并使用它
amount = '200'
for number in numbers:
((just_number*int('1000'))+int(amount))
以便我可以多次遍历amount
喜欢
23200
23400
23600
...
答案 0 :(得分:0)
根据您在评论中的问题。这是您的操作方法。
假设您要生成n个数字。 所以,
numbers =n
amount = '200'
your_text = "23FLAT"
just_number = your_text.strip("FLAT")
initial_number = int(just_number+amount)
amount_int = int(amount)
for i in range(numbers):
print(initial_number + i*amount_int)