Vlákno názorů k článku
Líbísenámsoukromí.cz
od nic moc ale jde to - require 'rubygems'
require 'watir'
def get_string ie,name, divs,vybrat
...
def get_string ie,name, divs,vybrat
link= "http://libimseti.cz/#{name}"
ie||= Watir::IE.start
ie.goto(link)
test="Kaoma68 (40.8) Praha 10 | libimseti.cz/Kaoma68"
popis=ie.div(:id,"nadpisasvatek").text
raise "Kaoma" if popis==test
out=[popis]
divs.each do |di|
d= ie.div(:id,di)
v=vybrat[di]
d.tables.each { |t| t.rows.each do |r|
tisk=false
r.cells.each do |c|
str=c.to_s
if tisk
out<<str
else
if v.include?(str)
tisk=true
else
break
end
end
end
end }
end
out
end
def read_dir path
d=Dir.new(path)
d.seek(2)
while x=d.read
new_path=File.join(path,x)
yield(new_path) if File.directory?(new_path)
end
end
read_dir(Path) do |p|
read_dir(p) do |path|
spl=path.split("/")
begin
str=([spl[3]+"/"+spl[4]]<< get_string(ie,spl[4],divs,vybrat).join(";"))
rescue Watir::Exception::UnknownObjectException,RuntimeError
str= "#{path} made error"
end
p str
f.puts str
end
end