Python阻止Splinter等待加载所有内容

时间:2018-02-26 13:01:59

标签: python selenium splinter

现在Splinter将在包含大量广告和内置跟踪的网页上加载20秒

@Data
@NoArgsConstructor(access = AccessLevel.PRIVATE)
@Entity
@Table(name = "aggregate1")
public class Aggregate1 {

    ...

    @OneToMany(fetch = FetchType.EAGER, mappedBy = "aggregate1Id", cascade = { ALL }, orphanRemoval = true)
    private final Set<Association> associations = new HashSet<>();

    ...
}

我知道硒允许

browser.visit("https://www.website.com")

但Splinter不接受这些参数。

2 个答案:

答案 0 :(得分:1)

启动浏览器时必须传递功能

browser = Browser('firefox', capabilities={'pageLoadStrategy': True})
browser.visit("https://www.website.com")

答案 1 :(得分:0)

将正确答案设置为pageLoadStrategynormal

browser = Browser('firefox', capabilities={'pageLoadStrategy': 'normal'})
browser.visit('https://stackoverflow.com/')