L
L
lynx06542014-03-01 19:19:34
linux
lynx0654, 2014-03-01 19:19:34

How to implement a web search script in Python?

#!/usr/bin/env python
# -*- coding:utf-8 -*-
import webbrowser
print("1 yandex")
print("2 google")
print("3 habrahabr")
print("4 forum. ubuntu")
p1=raw_input("enter the order of your search engine: №")
# and then how to implement???
# I just want advice to write code and I will come up with it myself (I'm learning)
s1=raw_input("enter a search query: ")
s2=raw_input("exclusion words: ")
url=" www.yandex.ru/yandsearch?text= "+s1+ " ~~ "+s2+""
webbrowser.
TQmEqZmqUBw.jpg

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
Konstantin Dovnar, 2014-03-01
@SolidlSnake

Dig towards urllib / 2 .

L
lynx0654, 2014-03-01
@lynx0654

until it stopped. I will study and study...
Xba7Xm-ukxk.jpg

X
xfenix, 2014-05-24
@xfenix

Better not dig in the direction of urllib2 as you were told there.
First, there are docs.python-requests.org/en/latest requests for people.
Secondly, there is scrapy.org/ for such tasks, which allows you to avoid writing bicycles.
Thirdly, you need to learn python first, you simply don’t understand that the code in python is indented.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question