水平滚动视图,两行内容

时间:2018-09-24 09:44:39

标签: react-native flexbox

我想渲染包含两行项目的水平滚动视图,其中项目具有动态大小。我已经尝试设置滚动视图的高度并将其应用于带有flex方向列的containerStyle flex-wrap,如此处React Native horizontal FlatList with multiple rows所示。

但是,由于一列中的两个元素具有相同的大小,因此结果与预期不符。

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import pandas as pd

url = 'https://www.investing.com/economic-calendar/chinese-cpi-743'

driver = webdriver.Chrome(r"D:\Projects\Tutorial\Driver\chromedriver.exe")
driver.get(url)
wait = WebDriverWait(driver,10)

while True:
    try:
        item = wait.until(EC.visibility_of_element_located((By.XPATH,'//*[contains(@id,"showMoreHistory")]/a')))
        driver.execute_script("arguments[0].click();", item)
    except Exception:break

for table in wait.until(EC.visibility_of_all_elements_located((By.XPATH,'//*[contains(@id,"eventHistoryTable")]//tr'))):
    data = [item.text for item in table.find_elements_by_xpath(".//*[self::td or self::th]")]
    for data in data:
        df = pd.DataFrame(data.strip(), columns=['Release Date', 'Time', 'Actual', 'Forecast', 'Previous'])
        print(df)

当前结果: enter image description here

0 个答案:

没有答案