Lefschetz on étale fundamental group for quasi-projective varieties

This won't work for arbitrary smooth quasiprojective varieties. Take $X = \mathbb A^n$, then certainly any $H = \mathbb A^{n-1}$,.

But $\pi_1(\mathbb A^{n-1}) \to \pi_1(\mathbb A^n)$ is not an isomorphism in characteristic $p$ because there are nontrivial finite etale coverings of $\mathbb A^1$, which when pulled back to $\mathbb A^n$ become nontrivial coverings of $\mathbb A^n$ that trivialize when restricted to $\mathbb A^{n-1}$.


I am posting my comments above as an answer, together with a reference (per the OP's request). The difference between Will's answer and my answer results from the ambiguous term "general". Only the OP can specify what is meant by "general" in the question. In this answer, I interpret "general" as meaning "the property is true for the geometric generic point".

Let $k$ be an algebraically closed field. Let $X$ be an integral $k$-scheme of dimension $\geq 2$, and let $f:X\to \mathbb{P}^n_k$ be a finite type morphism that is unramified on a dense, open subscheme of $X$. Denote by $(\mathbb{P}^n_k)^\vee$ the projective space parameterizing hyperplanes in $\mathbb{P}^n_k$. In particular, for every algebraically closed field extension $\kappa/k$, there is a natural bijection between the hyperplanes $H\subset \mathbb{P}^n_\kappa$ and the $k$-morphisms $[H]:\text{Spec}(\kappa) \to (\mathbb{P}^n_k)^\vee$.

Let me restate Corollary 2.2 of the following (which, in turn, depends on Théorème 4.10 and 6.10 of Jouanolou's "Théorèmes de Bertini et applications").

MR3114946
Graber, Tom; Starr, Jason Michael
Restriction of sections for families of abelian varieties.
A celebration of algebraic geometry, 311–327,
Clay Math. Proc., 18, Amer. Math. Soc., Providence, RI, 2013.

For every generically finite morphism $g:Y\to X$ that admits no rational section, there exists a dense, Zariski open subscheme $U\subset (\mathbb{P}^n_k)^\vee$ such that for every algebraically closed field $\kappa$ and for every geometric point $[H]:\text{Spec}(\kappa) \to U$, also $Y\times_{\mathbb{P}^n_k} H \to X\times_{\mathbb{P}^n_k} H$ admits no rational section.

Now let $K$ denote the algebraic closure of the function field of $(\mathbb{P}^n_k)^\vee$ as an extension of $k$, and denote by $[H]:\text{Spec}(K)\to (\mathbb{P}^n_k)^\vee$ the corresponding $k$-morphism. Then for every connected, finite, etale morphism $g:Y\to X$, also the morphism $Y\times_{\mathbb{P}^n_k} H \to X\times_{\mathbb{P}^n_k} H$ is connected, finite and etale. Therefore, the induced homomorphism, $$\pi^1(X\times_{\mathbb{P}^n_k} H) \to \pi^1(X),$$ is surjective.